xref: /haiku/src/system/libroot/posix/unistd/pipe.c (revision 3be9edf8da228afd9fec0390f408c964766122aa)
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 <syscalls.h>
10 
11 
12 int
13 pipe(int streams[2])
14 {
15 	status_t error = _kern_create_pipe(streams);
16 	if (error != B_OK) {
17 		errno = error;
18 		return -1;
19 	}
20 
21 	return 0;
22 }
23