home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / mntlib16.lzh / MNTLIB16 / PIPE.C < prev    next >
C/C++ Source or Header  |  1993-07-29  |  333b  |  26 lines

  1. /*
  2.  * pipe: create a pipe
  3.  * works only under MiNT
  4.  */
  5.  
  6. #include <osbind.h>
  7. #include <errno.h>
  8. #include "mintbind.h"
  9.  
  10. int
  11. pipe(fd)
  12.     int *fd;
  13. {
  14.     short mint_handle[2];
  15.     long r;
  16.  
  17.     r = Fpipe(mint_handle);
  18.     if (r < 0) {
  19.         errno = -r;
  20.         return -1;
  21.     }
  22.     fd[0] = mint_handle[0];
  23.     fd[1] = mint_handle[1];
  24.     return 0;
  25. }
  26.