-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathprocess.jou
More file actions
32 lines (28 loc) · 1.06 KB
/
Copy pathprocess.jou
File metadata and controls
32 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Functions for working with processes (i.e. running programs).
#
# Many functions apply to the current process. Some create new
# processes as subprocesses of the current process.
# Run a command in a new subprocess. Return value 0 means it succeeded.
@public
declare system(command: byte*) -> int
# Exit the current process.
@public
declare exit(status: int) -> noreturn # Clean exit. Status 0 is success, other status (usually 1) means fail.
@public
declare abort() -> noreturn # Hard exit. Similar to a crash.
# Each process has a list of environment variables, and each child
# process inherits its parent's variables. These functions access
# the environment variables of the current process.
@public
declare getenv(varname: byte*) -> byte* # Returns NULL if not found.
# chdir(path) changes the working directory of the current process.
# Return value 0 means it succeeded.
if WINDOWS:
declare _chdir(path: byte*) -> int
@public
@inline
def chdir(path: byte*) -> int:
return _chdir(path)
else:
@public
declare chdir(path: byte*) -> int