1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include <android/log.h>
11 main(int argc
, char* argv
[])
13 // Check for the absolute minimum number of args we need to move
14 // forward here. We expect the last arg to be the child process type.
18 void *mozloader_handle
= dlopen("libmozglue.so", RTLD_LAZY
);
19 if (!mozloader_handle
) {
20 __android_log_print(ANDROID_LOG_ERROR
, "GeckoChildLoad",
21 "Couldn't load mozloader because %s", dlerror());
25 typedef int (*ChildProcessInit_t
)(int, char**);
26 ChildProcessInit_t fChildProcessInit
=
27 (ChildProcessInit_t
)dlsym(mozloader_handle
, "ChildProcessInit");
28 if (!fChildProcessInit
) {
29 __android_log_print(ANDROID_LOG_ERROR
, "GeckoChildLoad",
30 "Couldn't load cpi_t because %s", dlerror());
34 return fChildProcessInit(argc
, argv
);