aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/c/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/c/exec.c')
-rw-r--r--app/src/main/c/exec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/c/exec.c b/app/src/main/c/exec.c
index a9871a5..d665341 100644
--- a/app/src/main/c/exec.c
+++ b/app/src/main/c/exec.c
@@ -1,6 +1,7 @@
1#include <jni.h> 1#include <jni.h>
2#include <unistd.h> 2#include <unistd.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#include <sys/wait.h>
4 5
5static inline const char **to_string_array(JNIEnv *env, jobjectArray ja) { 6static inline const char **to_string_array(JNIEnv *env, jobjectArray ja) {
6 const int len = (*env)->GetArrayLength(env, ja); 7 const int len = (*env)->GetArrayLength(env, ja);
@@ -32,3 +33,8 @@ Java_org_pacien_tincapp_commands_Executor_forkExec(JNIEnv *env, jclass class, jo
32 return pid; 33 return pid;
33 } 34 }
34} 35}
36
37JNIEXPORT jint JNICALL
38Java_org_pacien_tincapp_commands_Executor_wait(JNIEnv *env, jclass class, jint pid) {
39 return waitpid(pid, NULL, 0);
40}