blob: ad48602e813be3e842ca2e574418427a98e589d3 [file] [log] [blame]
Tom Cherryde6bd502018-02-13 16:50:08 -08001/*
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
17#ifndef _INIT_HOST_INIT_STUBS_H
18#define _INIT_HOST_INIT_STUBS_H
19
20#include <stddef.h>
21#include <sys/socket.h>
22#include <sys/types.h>
23
24#include <string>
25
26// sys/system_properties.h
27#define PROP_VALUE_MAX 92
28
29// unistd.h
30int setgroups(size_t __size, const gid_t* __list);
31
32// android-base/properties.h
33namespace android {
34namespace base {
35
36std::string GetProperty(const std::string& key, const std::string& default_value);
37bool GetBoolProperty(const std::string& key, bool default_value);
Tom Cherry12578122018-04-11 15:50:00 -070038template <typename T>
39T GetIntProperty(const std::string&, T default_value, T = std::numeric_limits<T>::min(),
40 T = std::numeric_limits<T>::max()) {
41 return default_value;
42}
Tom Cherryde6bd502018-02-13 16:50:08 -080043
44} // namespace base
45} // namespace android
46
47namespace android {
48namespace init {
49
50// init.h
51extern std::string default_console;
52
53// property_service.h
54extern uint32_t (*property_set)(const std::string& name, const std::string& value);
55uint32_t HandlePropertySet(const std::string& name, const std::string& value,
Tom Cherry69d47aa2018-03-01 11:00:57 -080056 const std::string& source_context, const ucred& cr, std::string* error);
Tom Cherryde6bd502018-02-13 16:50:08 -080057
58// selinux.h
Logan Chienc50144e2018-05-03 14:33:52 +080059bool SelinuxHasVendorInit();
Tom Cherryde6bd502018-02-13 16:50:08 -080060void SelabelInitialize();
61bool SelabelLookupFileContext(const std::string& key, int type, std::string* result);
62
63} // namespace init
64} // namespace android
65
66#endif