blob: 800cdb0d2fc8b3ace9a47b5283288c9e52080d9a [file] [log] [blame] [raw]
/*
* This file has no copyright assigned and is placed in the Public Domain.
* No warranty is given.
*
* Written by PC GO
*
*/
#include <windows.h>
int dup(int oldfd) {
void *r;
int ok = DuplicateHandle(GetCurrentProcess(), (void *)oldfd, GetCurrentProcess(), &r, 0, 1, DUPLICATE_SAME_ACCESS);
return ok ? (int)r : -1;
}