Crates.io | raw-syscall-enumerated |
lib.rs | raw-syscall-enumerated |
version | 0.7.6 |
source | src |
created_at | 2018-10-04 18:33:59.01094 |
updated_at | 2018-10-04 18:33:59.01094 |
description | Low-level raw system calls enumerated. |
homepage | |
repository | |
max_upload_size | |
id | 88063 |
size | 72,857 |
Low level system calls.
Add the following to your Cargo.toml
:
raw-syscall-enumerated = "0.7.6"
This crate builds on raw-syscall-base
, providing a function for each system call on the platform.
All functions are marked unsafe, and no validation is done on arguments or return values.
All arguments and return values use the most basic possible types, for example everything is usize
on x86_64-linux
. All arguments must be converted to this type, and it's up to the caller to determine whether the result represents a pointer or error code or whatever.
All system calls through the latest release of the platform should be supported here. Deprecated system calls should be supported as well. It is up to higher level libraries to check the platform version and prevent unsupported calls from being made if this is desired.
The intention is to provide a minimal stable base with no unnecessary overhead on which to build a higher-level library.
use raw_syscall_enumerated::{write, exit_group};
// attempts to write "hello" to STDOUT
pub unsafe fn hello() -> usize {
write(1, b"hello" as *const u8 as usize, 5)
}
// exits the program with a success code
pub unsafe fn exit_success() -> ! {
exit_group(0)
}