X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cdd4d20278cbee5a9f11f9f455bff8836410568c..f9b13d923d31bb0336aeeaab6d5b7ba33812f3f7:/src/xbt/xbt_virtu.cpp diff --git a/src/xbt/xbt_virtu.cpp b/src/xbt/xbt_virtu.cpp index 557a2d3e03..016705448a 100644 --- a/src/xbt/xbt_virtu.cpp +++ b/src/xbt/xbt_virtu.cpp @@ -1,21 +1,22 @@ /* virtualization layer for XBT */ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "simgrid/simix.h" +#include +#include + #include "src/kernel/actor/ActorImpl.hpp" -#include "xbt/virtu.h" int xbt_getpid() { - smx_actor_t self = SIMIX_process_self(); - return self == nullptr ? 0 : self->get_pid(); + const auto* self = simgrid::kernel::actor::ActorImpl::self(); + return self == nullptr ? 0 : static_cast(self->get_pid()); } const char* xbt_procname(void) { - return SIMIX_process_self_get_name(); + return simgrid::s4u::Actor::is_maestro() ? "maestro" : simgrid::kernel::actor::ActorImpl::self()->get_cname(); }