• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <android-base/properties.h>
20 
21 // unistd.h
setgroups(size_t __size,const gid_t * __list)22 int setgroups(size_t __size, const gid_t* __list) {
23     return 0;
24 }
25 
26 namespace android {
27 namespace init {
28 
29 // init.h
30 std::string default_console = "/dev/console";
31 
32 // property_service.h
CanReadProperty(const std::string & source_context,const std::string & name)33 bool CanReadProperty(const std::string& source_context, const std::string& name) {
34     return true;
35 }
SetProperty(const std::string & key,const std::string & value)36 uint32_t SetProperty(const std::string& key, const std::string& value) {
37     android::base::SetProperty(key, value);
38     return 0;
39 }
40 uint32_t (*property_set)(const std::string& name, const std::string& value) = SetProperty;
HandlePropertySet(const std::string &,const std::string &,const std::string &,const ucred &,std::string *)41 uint32_t HandlePropertySet(const std::string&, const std::string&, const std::string&, const ucred&,
42                            std::string*) {
43     return 0;
44 }
45 
46 // selinux.h
SelinuxGetVendorAndroidVersion()47 int SelinuxGetVendorAndroidVersion() {
48     return 10000;
49 }
SelabelInitialize()50 void SelabelInitialize() {}
51 
SelabelLookupFileContext(const std::string & key,int type,std::string * result)52 bool SelabelLookupFileContext(const std::string& key, int type, std::string* result) {
53     return false;
54 }
55 
56 }  // namespace init
57 }  // namespace android
58