/* * fork->exec test. * * Copyright (C) Philippe Gerum * * Released under the terms of GPLv2. */ #include #include #include #include #include smokey_test_plugin(posix_fork, SMOKEY_NOARGS, "Check POSIX fork->exec sequence." ); /* * The purpose of this test is to check whether Cobalt detects and * handles a fork->exec sequence properly for Xenomai-enabled threads, * with respect to managing their respective shadow contexts. Cobalt * should drop the child's shadow upon detecting exec(), then create * another one for the emerging process's main() thread as usual. * * We don't have to do much beyond firing such sequence fo testing: if * Cobalt messes up, the kernel will certainly crash. */ static int run_posix_fork(struct smokey_test *t, int argc, char *const argv[]) { /* * Re-exec ourselves without running any test, this is * enough for creating a shadow context. */ return smokey_fork_exec(argv[0], "smokey"); }