michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: sw=4 ts=4 et : michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: int michael@0: main(int argc, char* argv[]) michael@0: { michael@0: // Check for the absolute minimum number of args we need to move michael@0: // forward here. We expect the last arg to be the child process type. michael@0: if (argc < 2) michael@0: return 1; michael@0: michael@0: void *mozloader_handle = dlopen("libmozglue.so", RTLD_LAZY); michael@0: if (!mozloader_handle) { michael@0: __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad", michael@0: "Couldn't load mozloader because %s", dlerror()); michael@0: return 1; michael@0: } michael@0: michael@0: typedef int (*ChildProcessInit_t)(int, char**); michael@0: ChildProcessInit_t fChildProcessInit = michael@0: (ChildProcessInit_t)dlsym(mozloader_handle, "ChildProcessInit"); michael@0: if (!fChildProcessInit) { michael@0: __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad", michael@0: "Couldn't load cpi_t because %s", dlerror()); michael@0: return 1; michael@0: } michael@0: michael@0: return fChildProcessInit(argc, argv); michael@0: }