Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / src / xbt / xbt_virtu.cpp
1 /* virtualization layer for XBT */
2
3 /* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include <simgrid/s4u/Actor.hpp>
9 #include <xbt/virtu.h>
10
11 #include "src/kernel/actor/ActorImpl.hpp"
12
13 int xbt_getpid()
14 {
15   const auto* self = simgrid::kernel::actor::ActorImpl::self();
16   return self == nullptr ? 0 : static_cast<int>(self->get_pid());
17 }
18
19 const char* xbt_procname(void)
20 {
21   return simgrid::s4u::Actor::is_maestro() ? "maestro" : simgrid::kernel::actor::ActorImpl::self()->get_cname();
22 }