delorie.com/djgpp/doc/libc/libc_282.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#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.
ANSI/ISO C | No |
POSIX | 1003.2-1992; 1003.1-2001 |
/* copy new file to stdin stream */ close(0); dup2(new_stdin, 0); close(new_stdin); |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |