aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/process/pipe.cpp
blob: 924e05c8f4ee32948d264e4deeae10837e606c4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright Vespa.ai. 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