feat: add Process.pid and Process.ppid foreign static methods to os module

Implement uv_os_getpid() and uv_os_getppid() bindings in process.c, register them in the CLI module table, expose as foreign statics in os.wren, and add a test suite verifying both return positive integers with pid greater than ppid.
This commit is contained in:
Dario Vladović
2021-04-28 21:51:23 +00:00
parent 7b56ba281b
commit 5118fb6561
5 changed files with 38 additions and 10 deletions
+11
View File
@@ -0,0 +1,11 @@
import "os" for Process
System.print(Process.pid is Num) // expect: true
System.print(Process.pid.isInteger) // expect: true
System.print(Process.pid > 0) // expect: true
System.print(Process.ppid is Num) // expect: true
System.print(Process.ppid.isInteger) // expect: true
System.print(Process.ppid > 0) // expect: true
System.print(Process.pid > Process.ppid) // expect: true