1// Copyright 2013 The Chromium 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#ifndef BASE_ANDROID_FIFO_UTILS_H_
6#define BASE_ANDROID_FIFO_UTILS_H_
7
8#include <stdio.h>
9
10#include "base/base_export.h"
11#include "base/basictypes.h"
12
13namespace base {
14
15class FilePath;
16
17namespace android {
18
19// Creates a fifo at the given |path| with POSIX permissions set to |mode|,
20// returning true if it was successfully created and permissions were set.
21BASE_EXPORT bool CreateFIFO(const FilePath& path, int mode);
22
23// Redirects the |stream| to the file provided by |path| with |mode|
24// permissions, returning true if successful.
25BASE_EXPORT bool RedirectStream(FILE* stream,
26                                const FilePath& path,
27                                const char* mode);
28
29}  // namespace android
30}  // namespace base
31
32#endif  // BASE_ANDROID_FIFO_UTILS_H_
33