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
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 // android/api-level.h
27 #define __ANDROID_API_P__ 28
28
29 // sys/system_properties.h
30 #define PROP_VALUE_MAX 92
31
32 // unistd.h
33 int setgroups(size_t __size, const gid_t* __list);
34
35 namespace android {
36 namespace init {
37
38 // init.h
39 extern std::string default_console;
40
41 // property_service.h
42 bool CanReadProperty(const std::string& source_context, const std::string& name);
43 extern uint32_t (*property_set)(const std::string& name, const std::string& value);
44 uint32_t HandlePropertySet(const std::string& name, const std::string& value,
45 const std::string& source_context, const ucred& cr, std::string* error);
46
47 // reboot_utils.h
SetFatalRebootTarget()48 inline void SetFatalRebootTarget() {}
InitFatalReboot()49 inline void __attribute__((noreturn)) InitFatalReboot() {
50 abort();
51 }
52
53 // selinux.h
54 int SelinuxGetVendorAndroidVersion();
55 void SelabelInitialize();
56 bool SelabelLookupFileContext(const std::string& key, int type, std::string* result);
57
58 } // namespace init
59 } // namespace android
60
61 #endif
62