home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / SYS / DUP2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  369 b   |  21 lines

  1. /* sys/dup2.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <os2emx.h>
  5. #include "syscalls.h"
  6.  
  7. int __dup2 (int handle1, int handle2)
  8. {
  9.   ULONG rc;
  10.   HFILE new;
  11.  
  12.   new = handle2;
  13.   rc = DosDupHandle (handle1, &new);
  14.   if (rc != 0)
  15.     {
  16.       _sys_set_errno (rc);
  17.       return (-1);
  18.     }
  19.   return (new);
  20. }
  21.