13 releases

Uses old Rust 2015

0.0.14 May 24, 2017
0.0.13 May 24, 2017
0.0.12 Apr 25, 2017
0.0.11 Oct 1, 2016
0.0.10 Sep 19, 2016

#405 in Unix APIs

Download history 89/week @ 2023-11-06 70/week @ 2023-11-13 95/week @ 2023-11-20 96/week @ 2023-11-27 64/week @ 2023-12-04 87/week @ 2023-12-11 75/week @ 2023-12-18 95/week @ 2023-12-25 49/week @ 2024-01-01 74/week @ 2024-01-08 82/week @ 2024-01-15 53/week @ 2024-01-22 62/week @ 2024-01-29 65/week @ 2024-02-05 119/week @ 2024-02-12 315/week @ 2024-02-19

561 downloads per month
Used in 21 crates (7 directly)

MIT license

1MB
13K SLoC

[](This file is part of syscall-alt. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/syscall-alt/master/COPYRIGHT. No part of syscall-alt, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.) [](Copyright © 2016 The developers of syscall-alt. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/syscall-alt/master/COPYRIGHT.)

syscall-alt

syscall-alt is a rust crate that provides inline assembler (asm! macro) definitions of syscalls for some Linux platforms. It also includes:-

  • An enum defining common Linux syscalls;
  • Some minor wrapper logic to make straightforward to work with syscalls.
  • Correct Syscall / Posix error codes ('E'), eg EINVAL
    • Linux:-
      • These differ slightly on MIPS and PowerPC
      • MIPS64 is the same as MIPS
      • PowerPC64 is the same as PowerPC
      • PowerPC is nearly identical to x86_64 bar EDEADLOCK:-
        • PowerPC is the only platform on which EDEADLOCK != EDEADLK (so watch out when using match)
      • MIPS is very different to x86_64
        • But it has exactly the same set of E numbers
  • SYS call numbers and E numbers are available for every arch, eg if you want to know them for arm, but are compiled for x86_64, they are available
    • Watch out if using EDEADLOCK, EDEADLCK, ENOTSUP and EOPNOTSUPP; these vary in definition and value, sometimes being missing, sometimes being equal
    • Take a little care with EWOULDBLOCK and EAGAIN; all current platforms make EWOULDBLOCK the same as EAGAIN, but this isn't required by POSIX
  • A windows stub, which contains EAGAIN, etc, as defined on Windows (but no syscall numbers)

The code is very much 'early-days', so expect breaking changes.

This crate is #[!no_std], and does not require the std library or the libc crate

TODO

Licensing

The license for this project is AGPL.

No runtime deps