Remove filterfd.
Neat party trick, but not generally useful enough
to belong in libstd.
@@ -12,7 +12,6 @@ pkg std =
const espork : (cmd : byte[:][:] -> result((pid, fd, fd, fd), errno))
const sporkdir : (cmd : byte[:][:], dir : byte[:] -> result((pid, fd, fd), errno))
const esporkdir : (cmd : byte[:][:], dir : byte[:] -> result((pid, fd, fd, fd), errno))
- const filterfd : (fd : fd, cmd : byte[:][:] -> result(pid, errno))
;;
const run = {cmd
@@ -117,26 +116,6 @@ const esporkdir = {cmd, dir
-> `Err err
}
-const filterfd = {fd, cmd
- var outfds : fd[2]
- var err
-
- err = pipe(&outfds)
- if err != Enone
- -> `Err err
- ;;
-
- match sporkfd(cmd, "", [fd, -1], outfds, [-1, 2])
- | `Ok pid:
- dup2(outfds[0], fd)
- close(outfds[0]);
- close(outfds[1]);
- -> `Ok pid
- | `Err e:
- -> `Err e
- ;;
-}
-
const sporkfd = {cmd, dir, infds, outfds, errfds
var pid
