Go to the first, previous, next, last section, table of contents.


dup

Syntax

#include <unistd.h>

int dup(int old_handle);

Description

This function duplicates the given file handle. Both handles refer to the same file and file pointer.

Return Value

The new file handle, or -1 if error.

Portability

not ANSI, POSIX

Example

do_file(dup(fileno(stdin)));


Go to the first, previous, next, last section, table of contents.