From: sof Date: Mon, 20 Jul 1998 16:20:46 +0000 (+0000) Subject: [project @ 1998-07-20 16:20:46 by sof] X-Git-Tag: Approx_2487_patches~506 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b4eaba71c66f19e32ac2ff47169a01d62b2a229b;p=ghc-hetmet.git [project @ 1998-07-20 16:20:46 by sof] - Added a word of warning on using 'executeFile' *and* have parent and child share open files. --- diff --git a/ghc/docs/users_guide/posix.vsgml b/ghc/docs/users_guide/posix.vsgml index 9896fd1..3df9af8 100644 --- a/ghc/docs/users_guide/posix.vsgml +++ b/ghc/docs/users_guide/posix.vsgml @@ -291,8 +291,19 @@ be written by hand. Care must be taken to ensure that the search path is extracted from the original environment, and not from the environment to be passed on to the new image. +NOTE: In general, sharing open files between parent and child +processes is potential bug farm, and should be avoided unless you +really depend on this `feature' of POSIX' @fork()@ semantics. Using +Haskell, there's the extra complication that arguments to +@executeFile@ might come from files that are read lazily (using +@hGetContents@, or some such.) If this is the case, then for your own +sanity, please ensure that the arguments to @executeFile@ have been +fully evaluated before calling @forkProcess@ (followed by +@executeFile@.) Consider yourself warned :-) + A successful @executeFile@ overlays the current process image with a new one, so it only returns on failure. + runProcess :: FilePath -- Command -> [String] -- Arguments