home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
LIBSRC.ZOO
/
libsrc
/
local
/
dup.c
< prev
next >
Wrap
Text File
|
1992-02-16
|
494b
|
31 lines
#define INCL_DOSFILEMGR
#define INCL_DOSERRORS
#include <os2.h>
#include <errno.h>
ULONG Dos32DupHandle() asm ("Dos32DupHandle");
int dup (int oldd, int newd)
{
int newdesc = newd;
ULONG rc;
rc = Dos32DupHandle (oldd, (PHFILE)&newd);
if (rc)
if (rc == ERROR_TOO_MANY_OPEN_FILES)
{
errno = EMFILE;
return (-1);
}
else
{
errno = EBADF;
return (-1);
}
return (newdesc);
}