Add pid/1 predicate to the os library

This commit is contained in:
Paulo Moura
2021-05-18 19:35:35 +01:00
parent 0eeae24049
commit b9ad6f4fd2
3 changed files with 16 additions and 1 deletions

View File

@@ -14,7 +14,8 @@
:- module(os, [getenv/2,
setenv/2,
unsetenv/1]).
unsetenv/1,
pid/1]).
:- use_module(library(error)).
:- use_module(library(charsio)).
@@ -33,6 +34,10 @@ unsetenv(Key) :-
must_be_env_var(Key),
'$unsetenv'(Key).
pid(PID) :-
can_be(integer, PID),
'$pid'(PID).
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For now, we only support a restricted subset of variable names.