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 #include "host_init_stubs.h" 18 19 // unistd.h 20 int setgroups(size_t __size, const gid_t* __list) { 21 return 0; 22 } 23 24 namespace android { 25 namespace base { 26 27 std::string GetProperty(const std::string&, const std::string& default_value) { 28 return default_value; 29 } 30 31 bool GetBoolProperty(const std::string&, bool default_value) { 32 return default_value; 33 } 34 35 } // namespace base 36 } // namespace android 37 38 namespace android { 39 namespace init { 40 41 // init.h 42 std::string default_console = "/dev/console"; 43 44 // property_service.h 45 uint32_t (*property_set)(const std::string& name, const std::string& value) = nullptr; 46 uint32_t HandlePropertySet(const std::string&, const std::string&, const std::string&, const ucred&, 47 std::string*) { 48 return 0; 49 } 50 51 // selinux.h 52 bool SelinuxHasVendorInit() { 53 return true; 54 } 55 56 void SelabelInitialize() {} 57 58 bool SelabelLookupFileContext(const std::string& key, int type, std::string* result) { 59 return false; 60 } 61 62 } // namespace init 63 } // namespace android 64