3 dup \- duplicate an open file descriptor
10 int dup(int oldfd, int newfd)
12 Given a file descriptor,
14 referring to an open file,
16 returns a new file descriptor referring to the same file.
20 is \-1 the system chooses the lowest available file descriptor.
25 for the new file descriptor
26 (closing any old file associated with
28 File descriptors are allocated dynamically,
29 so to prevent unwarranted growth of the file descriptor table,
33 be no greater than 20 more than the highest file descriptor ever used by
36 .B /sys/src/libc/9syscall