summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/lib/libposix/posix014.hs
blob: bb3518c440fe54dc9ab39b0c6f3e83bd1a388681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--!! Basic pipe usage
module Main(main) where

import Posix

main = do
  str <- getEffectiveUserName
  putStrLn str
  (rd, wd) <- createPipe
  n <- forkProcess
  case n of
    Nothing  -> do
       (str,_) <- fdRead rd 32
       -- avoid them zombies
       putStrLn str
    Just pid -> do
       fdWrite wd "Hi, there - forked child calling" 
--       getProcessStatus False True pid
       return ()