From 798fdfbc70a8160d7ec89a5829c01a0fccb40dd9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 12 Mar 2020 12:15:20 -0400 Subject: [PATCH] efl/exe: add 'pid' property Reviewers: bu5hm4n, segfaultxavi Reviewed By: bu5hm4n Subscribers: bu5hm4n, vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11451 --- src/lib/ecore/efl_exe.c | 10 ++++++++++ src/lib/ecore/efl_exe.eo | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index b2c6341523..4580a41351 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -580,6 +580,16 @@ _efl_exe_exit_signal_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) return pd->exit_signal; } +EOLIAN static int +_efl_exe_pid_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) +{ +#ifndef _WIN32 + if (pd->pid != -1) + return pd->pid; +#endif + return 0; +} + EOLIAN static Efl_Object * _efl_exe_efl_object_constructor(Eo *obj, Efl_Exe_Data *pd) { diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 23b68935e4..11f6519be3 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -51,6 +51,15 @@ class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Ef sig: int; [[The exit signal, or -1 if no exit signal happened.]] } } + @property pid { + [[The pid of the process, which is only accessible after the object has been finalized. + @since 1.24 + ]] + get { } + values { + pid: int; [[The pid, or 0 on failure.]] + } + } @property env { [[If $env is $NULL then the process created by this object is going to inherit the environment of this process.