move old cruft
[reactos.git] / reactos / lib / crtdll / old cruft / io / pipe.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: lib/crtdll/io/pipe.c
6 * PURPOSE: Creates a pipe
7 * PROGRAMER: DJ Delorie
8 * UPDATE HISTORY:
9 * 28/12/98: Appropriated for Reactos
10 */
11
12 #include <precomp.h>
13 #include <msvcrt/io.h>
14 #include <msvcrt/internal/file.h>
15
16
17 /*
18 * @implemented
19 */
20 int _pipe(int _fildes[2], unsigned int size, int mode )
21 {
22 HANDLE hReadPipe, hWritePipe;
23
24 if ( !CreatePipe(&hReadPipe,&hWritePipe,NULL,size))
25 return -1;
26
27 _fildes[0] = __fileno_alloc(hReadPipe, mode);
28 _fildes[1] = __fileno_alloc(hWritePipe, mode);
29
30 return 0;
31 }