Android-cuttlefish cvd tool
subprocess_options.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <string>
19
20namespace cuttlefish {
21
23 public:
25 : verbose_(true), exit_with_parent_(true), in_group_(false) {}
28#ifdef __linux__
29 SubprocessOptions& ExitWithParent(bool exit_with_parent) &;
30 SubprocessOptions ExitWithParent(bool exit_with_parent) &&;
31#endif
32 // The subprocess runs as head of its own process group.
33 SubprocessOptions& InGroup(bool in_group) &;
34 SubprocessOptions InGroup(bool in_group) &&;
35
36 SubprocessOptions& Strace(std::string strace_output_path) &;
37 SubprocessOptions Strace(std::string strace_output_path) &&;
38
39 bool Verbose() const { return verbose_; }
40 bool ExitWithParent() const { return exit_with_parent_; }
41 bool InGroup() const { return in_group_; }
42 const std::string& Strace() const { return strace_; }
43
44 private:
48 std::string strace_;
49};
50
51} // namespace cuttlefish
Definition: subprocess_options.h:22
const std::string & Strace() const
Definition: subprocess_options.h:42
bool InGroup() const
Definition: subprocess_options.h:41
bool verbose_
Definition: subprocess_options.h:45
bool ExitWithParent() const
Definition: subprocess_options.h:40
bool Verbose() const
Definition: subprocess_options.h:39
bool in_group_
Definition: subprocess_options.h:47
bool exit_with_parent_
Definition: subprocess_options.h:46
SubprocessOptions()
Definition: subprocess_options.h:24
std::string strace_
Definition: subprocess_options.h:48
Definition: alloc_driver.h:20
void verbose(const char *fmt,...)
Definition: util.cpp:69