| www.delorie.com/djgpp/doc/libc-2.01/libc_243.html | search |
#include <unistd.h> int dup2(int existing_handle, int new_handle);
This call causes new_handle to refer to the same file and file pointer as existing_handle. If new_handle is an open file, it is closed.
The new handle, or -1 on error.
/* copy new file to stdin stream */ close(0); dup2(new_stdin, 0); close(new_stdin);
Go to the first, previous, next, last section, table of contents.
| prev next webmaster | delorie software privacy |
| Copyright © 1997 | Updated Apr 1997 |