From: adfaure Date: Thu, 11 Aug 2016 08:50:28 +0000 (+0200) Subject: [s4u] add Actor::getPPid and this_actor::getPPid() X-Git-Tag: v3_14~575^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a844d6ba059b98ad6a5317e85a9c69402353b0a9?hp=e5a5b0f6ee35cb592f9345a9dafa0e29df8477ef [s4u] add Actor::getPPid and this_actor::getPPid() --- diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 5fbd5f8e20..a858bdf078 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -223,6 +223,8 @@ public: s4u::Host *getHost(); /** Retrieves the PID of that actor */ int getPid(); + /** Retrieves the PPID of that actor */ + int getPpid(); /** If set to true, the actor will automatically restart when its host reboots */ void setAutoRestart(bool autorestart); @@ -305,6 +307,11 @@ namespace this_actor { * Return the PID of the current actor. */ XBT_PUBLIC(int) getPid(); + + /** + * Return the PPID of the current actor. + */ + int getPpid(); }; diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index d14a9bfb0c..444fa6cbc9 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -74,6 +74,10 @@ int Actor::getPid(){ return pimpl_->pid; } +int Actor::getPpid() { + return pimpl_->ppid; +} + void Actor::setKillTime(double time) { simcall_process_set_kill_time(pimpl_,time); } @@ -158,6 +162,10 @@ int getPid() { return SIMIX_process_self()->pid; } +int getPpid() { + return SIMIX_process_self()->ppid; +} + } } }