Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2572244
main.rs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
526 B
Referenced Files
None
Subscribers
None
main.rs
View Options
use
std
::{
thread
,
time
::
Duration
};
#[cxx::bridge]
mod
cmd
{
unsafe
extern
"C++"
{
include!
(
"pmc/src/include/cmd.h"
);
fn
run_command
(
name
:
&
str
,
log_path
:
&
str
,
command
:
&
str
)
->
u64
;
fn
kill_pid
(
pid
:
u64
)
->
u64
;
}
}
fn
main
()
{
let
name
=
"example"
;
let
log_path
=
"tests/logs"
;
let
command
=
"node tests/index.js"
;
let
pid
=
cmd
::
run_command
(
&
name
,
&
log_path
,
&
command
);
println!
(
"pid: {pid}"
);
thread
::
sleep
(
Duration
::
from_millis
(
1000
));
cmd
::
kill_pid
(
pid
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Dec 16, 7:30 AM (4 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
484923
Default Alt Text
main.rs (526 B)
Attached To
Mode
rPMC Process Management Controller
Attached
Detach File
Event Timeline
Log In to Comment