1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
.\" Copyright (C) 1996-1999 Free Software Foundation, Inc.
.\"
.\" Permission is granted to make and distribute verbatim copies of
.\" this manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of
.\" this manual under the conditions for verbatim copying, provided that
.\" the entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Permission is granted to copy and distribute translations of this
.\" manual into another language, under the above conditions for modified
.\" versions, except that this permission notice may be stated in a
.\" translation approved by the Foundation.
.\"
.\" Copyright (C) 1996 Xavier Leroy.
.\"
.\" Japanese Version Copyright (C) 2000 WAKABAYASHI, Takeyasu
.\" all rights reserved.
.\" Translated on Fri Jan 14 16:50:24 JST 2000
.\" by WAKABAYASHI, Takeyasu <twakaba@eco.toyama-u.ac.jp>
.\" Updated and modified Sun Feb 2 01:39:34 JST 2003
.\" by Suzuki Takashi.
.\"
.\"WORD: install Ͽ
.\"
.TH PTHREAD_ATFORK 3 LinuxThreads
.SH "̾"
pthread_atfork \- fork(2) κݤ˸ƤӽФϥɥϿ
.SH ""
.BI "int pthread_atfork(void (*" prepare ")(void), void (*" parent ")(void), void (*" child ")(void));"
.\" .SH DESCRIPTION
.SH
.B "pthread_atfork"
.BR "fork" (2)
ˤäƿץݡľľ˸ƤӽФ
ϥɥؿϿ롣
.I "prepare"
ϥɥϡץľ˿ƥץ
ƤӽФ롣
.I "parent"
ϥɥϡ
.BR "fork" (2)
ľ˿ƥץƤӽФ롣
.I "child"
ϥɥ
.BR "fork" (2)
֤ľ˻ҥץƤӽФ롣
.IR "prepare" ,
.I "parent"
.I "child"
λĤΥϥɥΤΰĤޤʣ
.BR "NULL"
Ϳ뤳ȤǤ뤬бǤʤϥɥ
ƤӽФɬפʤȤ̣롣
.B "pthread_atfork"
ʣΥϥɥȹ礻Ͽ뤿ʣ
ƤӽФȤǽǤ롣
.BR "fork" (2)
λʣ
.I "prepare"
ϥɥ LIFO ǸƤӽФ(
.BR "pthread_atfork"
ǺǸ˲ä줿Τ
.BR "fork"
˺ǽ˸ƤӽФ)
¾
.I "parent"
.I "child"
FIFO ǸƤӽФ
(ǽ˲ä줿Τǽ˸ƤӽФ)
.BR "pthread_atfork"
Ū뤿ˡ
.BR "fork" (2)
ϡߥå֤ˤ mutex ޤơƤӽФåɤΤߤ
Τʣ뤳ȤפФĤޤꡢ¾Υåɤ
ҥץǤϼ¹ԤƤʤΤǤ롣äơ
.BR "fork"
ƤӽФåɰʳΥåɤˤä mutex åƤ
ΤʤС mutex ϻҥץDZʱ˥å줿ޤޤǤꡢ
ҥץμ¹Ԥ֥åǽ롣
뤿ˤϡ
.B "pthread_atfork"
ǼΤ褦ʥϥɥϿɤ:
.I "prepare"
ϥɥ餬Ū mutex (åݤν)å
.I "parent"
.I "child"
(դν)å롣
ޤϡ
.I "prepare"
.I "parent"
.B "NULL"
ꤷ
.I "child"
Ū mutex Ф
.B "pthread_mutex_init"
ƤӽФؿꤷƤɤ
.SH ֤
.B "pthread_atfork"
0 ֤顼Υ顼ɤ֤
.SH "顼"
.TP
.B "ENOMEM"
ϥɥϿΤ˥꤬ʤ
.SH ""
Xavier Leroy <Xavier.Leroy@inria.fr>
.SH "Ϣ"
.BR "fork" (2),
.BR "pthread_mutex_lock" (3),
.BR "pthread_mutex_unlock" (3).
[] glibc-linuxthreads κǿΥɥȤ TexinfoƤ롣
ʲ glibc-linuxthreads-2.3.1 Texinfo ե뤫ΰѤǤ롣
.B "pthread_atfork"
Ū뤿ˡ
.B "fork"
ߥå֤ˤ mutex ޤΤ
ƤӽФåɤʣ뤳ȤפФƤۤ
Ĥޤꡢ¾ΥåɤϻҥץǤϼ¹Ԥʤ
mutex
.B "fork"
θϻȤȤǤҥץ
.B "pthread_mutex_init"
ȤäƽʤФʤʤ
ϸߤμ¤ǡΥСǤ¸ߤ뤫⤷ʤ
¸ߤʤ⤷ʤ
뤿ˤϡ
.B "pthread_atfork"
ǼΤ褦ʥϥɥϿФ褤:
.I "prepare"
ϥɥ mutex (åݤν) å
.I "parent"
ϥɥ mutex å롣
.I "child"
ϥɥǤ
.B "pthread_mutex_init"
Ѥ mutex ʤФʤʤ
ѿʤɤ¾Ʊ֥ȤˤĤƤƱͤǤ롣
Х mutex fork ˥åȡ
¾ΥåɤϤ٤ơΥХ mutex ݸ
ɤΥƥΰ褫Ф롣ä
.B "fork"
ƥץΥɥ쥹֤ΥʥåץåȤȡ
ΥʥåץåȤͭǰꤷǡԡ롣
ҥץƱ֥Ȥ뤳Ȥ
ƥץΥåɥ֥ƥͳ褹ΤŬڤ뤳Ȥݾڤ롣
㤨С mutex ϳԤĥåɤԤ塼Ѥ
Ԥ塼ϻҥץǤϰ̣ʤ
mutex 뤳ȤǤΤȤн褹롣
|