pthread_atfork man page on BSDOS

Man page or keyword search:  
man Server   6284 pages
apropos Keyword Search (all sections)
Output format
BSDOS logo
[printable version]

PTHREAD_ATFORK(3)	    BSD Programmer's Manual	     PTHREAD_ATFORK(3)

NAME
     pthread_atfork - pthread fork handlers

SYNOPSIS
     #include <pthread.h>

     int
     pthread_atfork(void (*prepare)(void), void (*parent)(void),
	     void (*child)(void));

DESCRIPTION
     This interface is defined by IEEE Std1003.1c (``POSIX'').

     The pthread_atfork() function registers fork handlers to be called before
     and after a call to fork() in the context of the thread that calls
     fork().  The prepare fork handler is called before the actual fork opera-
     tion is completed.	 The parent fork handler is called in the parent pro-
     cess after the fork operation is completed.  The child fork handler is
     called in the newly created child process after the fork operation is
     completed.	 Any one of prepare, parent, and child may be NULL in which
     case no action is performed for that fork handler.

     Multiple calls to pthread_atfork() are allowed and the order of these
     calls is significant.  The parent and child fork handlers are called in
     the order they were established.  The prepare fork handlers are called in
     the reverse order.

RETURN VALUES
     The pthread_atfork() function returns 0 upon successful completion.  If
     an error occurs, a non-zero error value is returned.

ERRORS
     The pthread_atfork function may fail and return the following error:

     [ENOMEM]	   Insufficient memory to record the the fork handlers.

SEE ALSO
     pthreads(3),  pthread_exit(3),  fork(2)

STANDARDS
     The pthread_atfork function conforms to IEEE Std1003.1c (``POSIX'').

HISTORY
     The pthread_atfork function first appeared in BSD/OS 3.0.

BUGS
     No processing is performed for for variants such as vfork().  This is in-
     tentional.	 It is assumed that a call to vfork() will be followed by an
     exec() and no atfork processing is desired.

     In general calling fork() in a threaded application is a bad idea and is
     discouraged.

4th Berkeley Distribution	 June 3, 1996				     1
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server BSDOS

List of man pages available for BSDOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net