vbox的更動 23919 路徑 trunk/src/VBox/Runtime/r3/init.cpp
- 時間撮記:
- 2009-10-20 下午05:48:40 (15 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/init.cpp
r23892 r23919 42 42 # ifndef RT_OS_OS2 43 43 # include <pthread.h> 44 # include <signal.h> 45 # include <errno.h> 46 # define IPRT_USE_SIG_CHILD_DUMMY 44 47 # endif 45 48 #endif … … 204 207 } 205 208 209 210 #ifdef IPRT_USE_SIG_CHILD_DUMMY 211 /** 212 * Dummy SIGCHILD handler. 213 * 214 * Assigned on rtR3Init only when SIGCHILD handler is set SIGIGN or SIGDEF to 215 * ensure waitpid works properly for the terminated processes. 216 */ 217 static void rtR3SigChildHandler(int iSignal) 218 { 219 NOREF(iSignal); 220 } 221 #endif /* IPRT_USE_SIG_CHILD_DUMMY */ 222 223 206 224 /** 207 225 * rtR3Init worker. … … 296 314 atexit(rtR3ExitCallback); 297 315 316 #ifdef IPRT_USE_SIG_CHILD_DUMMY 317 /* 318 * SIGCHLD must not be ignored (that's default), otherwise posix compliant waitpid 319 * implementations won't work right. 320 */ 321 for (;;) 322 { 323 struct sigaction saOld; 324 rc = sigaction(SIGCHLD, 0, &saOld); AssertMsg(rc == 0, ("%d/%d\n", rc, errno)); 325 if ( rc != 0 326 || (saOld.sa_flags & SA_SIGINFO) 327 || ( saOld.sa_handler != SIG_IGN 328 && saOld.sa_handler != SIG_DFL) 329 ) 330 break; 331 332 /* Try install dummy handler. */ 333 struct sigaction saNew = saOld; 334 saNew.sa_flags = SA_NOCLDSTOP | SA_RESTART; 335 saNew.sa_handler = rtR3SigChildHandler; 336 rc = sigemptyset(&saNew.sa_mask); AssertMsg(rc == 0, ("%d/%d\n", rc, errno)); 337 struct sigaction saOld2; 338 rc = sigaction(SIGCHLD, &saNew, &saOld2); AssertMsg(rc == 0, ("%d/%d\n", rc, errno)); 339 if ( rc != 0 340 || ( saOld2.sa_handler == saOld.sa_handler 341 && !(saOld2.sa_flags & SA_SIGINFO)) 342 ) 343 break; 344 345 /* Race during dynamic load, restore and try again... */ 346 sigaction(SIGCHLD, &saOld2, NULL); 347 RTThreadYield(); 348 } 349 #endif /* IPRT_USE_SIG_CHILD_DUMMY */ 350 298 351 #ifdef IPRT_WITH_ALIGNMENT_CHECKS 299 352 /*
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器