Next: posix fd pipe, Previous: posix fd device, Up: posix fd [Index]
The functions dup
and dup2
are often used to prepare the
standard file descriptors of a child process right after a fork
call; Creating a subprocess, for details about
this usage.
Interface to the C function dup()
, (libc)dup. Duplicate the file descriptor fd. If
successful return a non–negative fixnum representing the new
descriptor, else raise an exception.
Interface to the C function dup2()
, (libc)dup. Duplicate the file descriptor old to
new. If successful return unspecified values, else raise an
exception.