2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include <dlog/dlog.h>
19 // loader file must have "User" execute label, because launchpad daemon runs
20 // with "System::Privileged" label.
21 int main(int argc, char* argv[]) {
22 dlog_print(DLOG_INFO, "CHROMIUM", "Begin wrt-loader");
23 void* handle = dlopen("/usr/bin/wrt", RTLD_NOW);
25 dlog_print(DLOG_ERROR, "CHROMIUM", "Failed to load wrt (%s)", dlerror());
29 typedef int (*MAIN_FUNC)(int argc, char* argv[]);
31 MAIN_FUNC real_main = reinterpret_cast<MAIN_FUNC>(dlsym(handle, "main"));
33 dlog_print(DLOG_ERROR, "CHROMIUM", "Failed to load real_main (%s)", dlerror());
37 int ret = real_main(argc, argv);