xref: /haiku/src/system/libroot/posix/unistd/pipe.c (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
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 pipe(int streams[2])
15 {
16 	status_t error = _kern_create_pipe(streams);
17 	if (error != B_OK) {
18 		__set_errno(error);
19 		return -1;
20 	}
21 
22 	return 0;
23 }
24