1/** 2 * \file 3 * \brief 4 */ 5 6/* 7 * Copyright (c) 2010, ETH Zurich and Mircosoft Corporation. 8 * All rights reserved. 9 * 10 * This file is distributed under the terms in the attached LICENSE file. 11 * If you do not find this file, copies can be found by writing to: 12 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. 13 */ 14 15#include "internal.h" 16#include <barrelfish/spawn_client.h> 17 18errval_t spawn(callback cb) 19{ 20 errval_t err; 21 22 if (check_leader()) { // Only leader spawns other nodes 23 char id[128]; 24 snprintf(id, 128, "%d", my_core_id); 25 char *xargv[] = {global_argv[0], id, NULL}; 26 err = spawn_program_on_all_cores(false, xargv[0], xargv, NULL, 27 SPAWN_FLAGS_DEFAULT, NULL, NULL); 28 if (err_is_fail(err)) { 29 USER_PANIC_ERR(err, "spawn_program_on_all_cores failed"); 30 } 31 } 32 33 cb(); 34 return SYS_ERR_OK; 35} 36