Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
557a2d3e03fafb3ad9cf62c3f1f136373bb84c97
[simgrid.git] / src / xbt / xbt_virtu.cpp
1 /* virtualization layer for XBT */
2
3 /* Copyright (c) 2007-2019. 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/simix.h"
9 #include "src/kernel/actor/ActorImpl.hpp"
10 #include "xbt/virtu.h"
11
12 int xbt_getpid()
13 {
14   smx_actor_t self = SIMIX_process_self();
15   return self == nullptr ? 0 : self->get_pid();
16 }
17
18 const char* xbt_procname(void)
19 {
20   return SIMIX_process_self_get_name();
21 }