home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / pipe.c < prev    next >
C/C++ Source or Header  |  1993-02-22  |  314b  |  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 = (int) -r;
  20.         return -1;
  21.     }
  22.     fd[0] = mint_handle[0];
  23.     fd[1] = mint_handle[1];
  24.     return 0;
  25. }
  26.