]> git.tdb.fi Git - libs/core.git/blob - source/io/unix/pipe.cpp
Move most platform-specific code into overlay directories
[libs/core.git] / source / io / unix / pipe.cpp
1 #include <unistd.h>
2 #include <msp/core/systemerror.h>
3 #include "handle_private.h"
4 #include "pipe.h"
5
6 namespace Msp {
7 namespace IO {
8
9 void Pipe::platform_init()
10 {
11         int pipe_fd[2];
12         if(pipe(pipe_fd)==-1)
13                 throw system_error("pipe");
14
15         *read_handle = pipe_fd[0];
16         *write_handle = pipe_fd[1];
17 }
18
19 } // namespace IO
20 } // namespace Msp