Commit Diff


commit - 5c65abd0607ea694a65fee66a05283d1021ea35e
commit + 87df77a28a58d36cfc93336867ae27a6679a3e17
blob - b8c6268487b71259fffcf9e84908d2b29bb95551
blob + 5d28e24ab091d568cf3e09a303a34ae3e489aa35
--- src/ecall.c
+++ src/ecall.c
@@ -279,7 +279,7 @@ void ecall (void)
 	i64 ret;
 	switch (a7) {
 	case SYS_getcwd:
-		ret = enosys ("getcwd");
+		ret = map (getcwd ((char *)a0, (size_t)a1) != NULL ? 0 : -1);
 		break;
 	case SYS_dup:
 		ret = map (dup ((int)a0));
@@ -748,6 +748,9 @@ void ecall (void)
 	case SYS_getpid:
 		ret = map (getpid ());
 		break;
+	case SYS_getppid:
+		ret = map (getppid ());
+		break;
 	case SYS_getuid:
 		ret = map (getuid ());
 		break;
blob - f107b56f5fe7a8f694784c2a8903a7c54f1e5c14
blob + aabbb53319a975fb8a50f598e6d714d18bd052ed
--- src/syscalls.inc
+++ src/syscalls.inc
@@ -143,6 +143,7 @@
 .set SYS_settimeofday, 170
 .set SYS_adjtimex, 171
 .set SYS_getpid, 172
+.set SYS_getppid, 173
 .set SYS_getuid, 174
 .set SYS_geteuid, 175
 .set SYS_getgid, 176