xref: /haiku/src/system/libroot/posix/unistd/pipe.c (revision 344ded80d400028c8f561b4b876257b94c12db4a)
1 /*
2  * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 #include <errno.h>
7 #include <unistd.h>
8 
9 #include <errno_private.h>
10 #include <syscalls.h>
11 
12 
13 int
14 pipe2(int streams[2], int flags)
15 {
16 	status_t error = _kern_create_pipe(streams, flags);
17 	if (error != B_OK) {
18 		__set_errno(error);
19 		return -1;
20 	}
21 
22 	return 0;
23 }
24 
25 
26 int
27 pipe(int streams[2])
28 {
29 	return pipe2(streams, 0);
30 }
31