blob: ad8c6969d8790bb2288fdb4f3b17cc58dcc726b7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "pipe.h"
#include <unistd.h>
namespace vespalib {
Pipe
Pipe::create()
{
int my_pipe[2];
if (pipe(my_pipe) == 0) {
return {FileDescriptor(my_pipe[0]),
FileDescriptor(my_pipe[1])};
}
return {FileDescriptor(),FileDescriptor()};
}
Pipe::~Pipe() = default;
} // namespace vespalib
|