Rivoreo Source Code Repositories
src.rivoreo.one
/
devel
/
celibc
/
a257a02110908bacfec9ae6e5933ad3450db0b76
/
.
/
posix-io
/
dup.c
blob: c6dea5c5f856a70c4d3fc1649c57f3c5dbde730d [
file
] [
log
] [
blame
] [
raw
]
#if _WCE >= 4
#include
<windows.h>
#include
<kfuncs.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
;
}
#endif