home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
LIBSRC.ZOO
/
libsrc
/
local
/
pipe.c
< prev
next >
Wrap
Text File
|
1992-02-16
|
474b
|
28 lines
#define INCL_DOSQUEUES
#define INCL_DOSERRORS
#include <os2.h>
#include <errno.h>
ULONG Dos32CreatePipe() asm ("Dos32CreatePipe");
int pipe (int *fildes)
{
ULONG rc;
HFILE ReadHandle;
HFILE WriteHandle;
rc = Dos32CreatePipe (&ReadHandle, &WriteHandle, 0);
if (rc == ERROR_NOT_ENOUGH_MEMORY)
{
errno = EFAULT;
return (-1);
}
fildes[0] = (int)ReadHandle;
fildes[1] = (int)WriteHandle;
return (0);
}