#syscall #raw #system #call #no_std

nightly no-std raw-syscall-enumerated

Low-level raw system calls enumerated

1 unstable release

0.7.6 Oct 4, 2018

#12 in #raw

Download history 6/week @ 2018-10-08 2/week @ 2018-10-15 16/week @ 2018-10-22

8 downloads per month

MIT-0 OR 0BSD

69KB
1.5K SLoC

raw-syscall-enumerated

Low level system calls.

Latest version Documentation Downloads License

Usage

Add the following to your Cargo.toml:

raw-syscall-enumerated = "0.7.6"

Supported Platforms

  • x86_64-linux

Purpose

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.

x86_64-linux Example

    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)
    }

Dependencies

~42KB