oscall 0.0.1

Low-level cross-platform interface to operating system services: files, memory mapping, networking and more, with no libc on Linux
Documentation
  • Coverage
  • 100%
    1187 out of 1187 items documented13 out of 482 items with examples
  • Size
  • Source code size: 2.0 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 82.4 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 29s Average build duration of successful builds.
  • all releases: 29s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • KarpelesLab/oscall
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MagicalTux

oscall

CI crates.io docs.rs License: MIT

A low-level, cross-platform interface to operating system services: files, memory mapping, networking, time, processes and more.

oscall talks to the operating system directly and has no dependencies:

OS Backend Architectures
Linux raw system calls, no libc x86_64, x86, aarch64, arm, riscv64, riscv32
fullrust the same raw system calls x86_64, x86, aarch64, armv7
macOS libSystem x86_64, aarch64
Windows kernel32, ntdll, ws2_32 x86_64, x86, aarch64
WebAssembly WASI preview 1 wasm32

It is no_std; the default std feature only adds conversions to and from std types.

What it covers

Module
mem page size, anonymous and file mappings, protection, reservations
io read/write on any handle, positional and vectored, pipes, standard handles
fs files, metadata, directories, links, locks, copy, directory-relative operations
time, rand clocks, sleep, the system random generator
sync, thread wait/wake on an address; the current thread
net sockets: IPv4, IPv6, Unix-domain; options; interfaces
event poll, and a Poller over epoll, kqueue or an I/O completion port: sockets, timers, signals, child processes
process spawning children, wait, kill, termination requests

Every function behaves the same on every system; what one system alone has is in an extension module named after it (fs::unix, net::linux, ...). On WebAssembly, what WASI lacks fails with ErrorKind::Unsupported.

use oscall::{fs, io};

let options = fs::OpenOptions::new().write(true).create(true);
let file = fs::open("hello.txt", &options)?;
io::write(&file, b"hello\n")?;

The API is not stable yet (0.0.x). The design is in docs/plan.md, the internals in docs/internals.md.

License

MIT