pthread_atfork man page on OpenBSD

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

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

NAME
     pthread_atfork - specify handler functions to call when the process forks

SYNOPSIS
     #include <pthread.h>

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

DESCRIPTION
     The pthread_atfork() function declares fork handlers to be called before
     and after fork(), in the context of the thread that called fork().	 The
     prepare fork handler will be called before fork() processing commences.
     The parent fork handler will be called after fork() processing completes
     in the parent process.  The child fork handler will be called after
     fork() processing completes in the child process.	If no handling is
     desired at one or more of these three points, the corresponding fork
     handler address(es) may be set to NULL.

     The order of calls to pthread_atfork() is significant.  The parent and
     child fork handlers will be called in the order in which they were
     established by calls to pthread_atfork().	The prepare fork handlers will
     be called in the opposite order.

RETURN VALUES
     Upon successful completion, pthread_atfork() will return a value of zero.
     Otherwise, an error number will be returned to indicate the error.

ERRORS
     pthread_atfork() will fail if:

     [ENOMEM]	   Insufficient table space exists to record the fork handler
		   addresses.  None of the handler lists are modified.

SEE ALSO
     fork(2), atexit(3)

STANDARDS
     pthread_atfork() conforms to IEEE Std 1003.1-2004 (``POSIX'').

OpenBSD 4.9			 May 31, 2007			   OpenBSD 4.9
[top]

List of man pages available for OpenBSD

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