1 // Copyright 2018 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <stdint.h>
8 
9 #include <fbl/unique_fd.h>
10 #include <zircon/types.h>
11 
12 namespace xdc {
13 
14 // Requests a host xdc server stream that the client can read from or write to.
15 //
16 // If successful, returns ZX_OK and stores the stream file descriptor in out_fd.
17 // The client is in charge of closing this file descriptor once they are finished.
18 //
19 // Otherwise returns ZX_ERR_ALREADY_BOUND if the stream has already been claimed,
20 // or ZX_ERR_IO otherwise.
21 zx_status_t GetStream(uint32_t stream_id, fbl::unique_fd* out_fd);
22 
23 }  // namespace xdc
24