Date: Fri, 4 Dec 1998 17:07:58 -0500 (EST) From: HighWind Software Information <info@highwind.com> To: tlambert@primenet.com Cc: current@FreeBSD.ORG Subject: Re: Thread fd locking and fork() Message-ID: <199812042207.RAA12304@highwind.com> In-Reply-To: <199812042133.OAA06102@usr01.primenet.com> (message from Terry Lambert on Fri, 4 Dec 1998 21:33:45 %2B0000 (GMT))
next in thread | previous in thread | raw e-mail | index | archive | help
> Then don't explicitly call close after the exec, since the fork() > wrapper in libc_r will Do The Right Thing(tm). What is the problem with calling close() after the exec()? That is a 100% valid thing to do. Saying, "do this instead" is nice, but doesn't address the bug in libc_r. Also, if you call fcntl() after the fork(), you will hang. The only thing you can do is fcntl() all your descriptors before the fork(). That is a bit crazy because you have to juggle everytime you want to do a fork()/exec(). Calling fcntl() in the parent also introduces other race conditions as other parts of the system might be calling fork(). My patch seems to fix it. -Rob To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812042207.RAA12304>