blob: c2a048cc0c4dc90790b7529377a4a306d2cc444c [file] [log] [blame]
David Pursell80f67022015-08-28 15:08:49 -07001/*
2 * Copyright (C) 2015 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
17#ifndef SHELL_SERVICE_H_
18#define SHELL_SERVICE_H_
19
20#if !ADB_HOST
21
22enum class SubprocessType {
23 kPty,
24 kRaw,
25};
26
27// Forks and starts a new shell subprocess. If |name| is empty an interactive
28// shell is started, otherwise |name| is executed non-interactively.
29//
30// Returns an open FD connected to the subprocess or -1 on failure.
31int StartSubprocess(const char* name, SubprocessType type);
32
33#endif // !ADB_HOST
34
35#endif // SHELL_SERVICE_H_