Examples from UNIX system programming in OCaml book http://ocamlunix.forge.ocamlcore.org