Add pid/1 predicate to the os library
This commit is contained in:
@@ -41,6 +41,7 @@ use std::net::{TcpListener, TcpStream};
|
||||
use std::num::NonZeroU32;
|
||||
use std::ops::Sub;
|
||||
use std::rc::Rc;
|
||||
use std::process;
|
||||
|
||||
use chrono::{offset::Local, DateTime};
|
||||
use cpu_time::ProcessTime;
|
||||
@@ -5351,6 +5352,12 @@ impl MachineState {
|
||||
let key = self.heap_pstr_iter(self[temp_v!(1)]).to_string();
|
||||
env::remove_var(key);
|
||||
}
|
||||
&SystemClauseType::PID => {
|
||||
let a1 = self[temp_v!(1)];
|
||||
let pid = process::id();
|
||||
let addr = self.heap.put_constant(Constant::Integer(Rc::new(Integer::from(pid))));
|
||||
(self.unify_fn)(self, a1, addr);
|
||||
}
|
||||
&SystemClauseType::CharsBase64 => {
|
||||
let padding = self.atom_argument_to_string(3);
|
||||
let charset = self.atom_argument_to_string(4);
|
||||
|
||||
Reference in New Issue
Block a user