/* sys/pipe.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */

#include <sys/emx.h>
#define INCL_DOSQUEUES
#include <os2emx.h>
#include "syscalls.h"

int __pipe (int *two_handles, int pipe_size)
{
  ULONG rc;

  rc = DosCreatePipe ((PHFILE)&two_handles[0], (PHFILE)&two_handles[1],
                      pipe_size);
  if (rc != 0)
    {
      _sys_set_errno (rc);
      return (-1);
    }
  return (0);
}
