On Tuesday 15 November 2011 11:20:44 Stern, Eli wrote: > Following is a concern that daemon() might fail due to scheduling. > > The daemon() function does not synchronize itself, and so it is prone to > failure depending on system scheduling. Example: > - Last line in a script is a process that uses daemon(). Within daemon: > * parent does fork(); > * Parent gets CPU, child did not start. > * Parent does _exit(); > * The script recognizes that the last line of the script has been > executed, and send a SIGHUP to the pgrp. * Child receives SIGHUP and > exits. > > All this can be avoided if the parent waits on waitpid till the child > detaches (setsid()). At this point the parent receives ECHILD on the > waitpid, and can exit safely.
doesn't your test case fail the same way on glibc ? i can't see the glibc code being any different here. and since daemon() isn't covered under POSIX, i'd simply say "if glibc fails in the same way, then oh well". -mike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
