nc
Execute system call directly. nc
do not depend on std
.
Usage
Add this to Cargo.toml
:
[]
= "0.4.8"
And add this to crate code:
extern crate nc;
Examples
Get file stat:
let mut statbuf = stat_t default;
match stat
Fork process:
let pid = fork;
match pid
Kill self:
let pid = getpid;
let ret = kill;
// Never reach here.
println!;
Stable version
For stable version of rustc, please install gcc
first.
As asm!
feature is unavailable in stable version. So we use a C library
instead to wrap syscall APIs.
Related projects
License
This library is release in Apache License.