2 stable releases

new 1.1.0 Mar 11, 2025
1.0.0 Sep 10, 2022

#151 in Unix APIs

Download history 116/week @ 2024-11-19 215/week @ 2024-11-26 267/week @ 2024-12-03 216/week @ 2024-12-10 257/week @ 2024-12-17 191/week @ 2024-12-24 91/week @ 2024-12-31 259/week @ 2025-01-07 127/week @ 2025-01-14 194/week @ 2025-01-21 234/week @ 2025-01-28 141/week @ 2025-02-04 128/week @ 2025-02-11 179/week @ 2025-02-18 217/week @ 2025-02-25 123/week @ 2025-03-04

663 downloads per month

0BSD license

120KB
3K SLoC

Linux syscall macros for Rust

This library defines syscall numbers and a syscall! macro for directly invoking Linux system calls.

The arch modules document available syscall numbers for all supported architectures, and the top-level module re-exports syscall numbers for the current target platform.

Supported architectures:

  • aarch64
  • arm
  • riscv64
  • s390x
  • x86
  • x86_64

To be supported by this library, an architecture must:

To depend on linux-syscall from a Bazel workspace:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rust_posix_errno",
    sha256 = "0c86c849ff673372fe6415d4004a233565b57b2884ea49d3b725dd1296cc2529",
    strip_prefix = "posix-errno-1.0.1",
    urls = ["https://github.com/jmillikin/rust-posix-errno/releases/download/v1.0.1/posix-errno-1.0.1.tar.xz"],
)

http_archive(
    name = "rust_linux_errno",
    sha256 = "009d58c93c806f178004a4cd30af211860bc44f8ce7d02eb4f544821add7ca99",
    strip_prefix = "linux-errno-1.0.1",
    urls = ["https://github.com/jmillikin/rust-linux-errno/releases/download/v1.0.1/linux-errno-1.0.1.tar.xz"],
)

http_archive(
    name = "rust_linux_syscall",
    # Obtain the package checksum from the release page:
    # https://github.com/jmillikin/rust-linux-syscall/releases/tag/v1.1.0
    sha256 = "",
    strip_prefix = "linux-syscall-1.1.0",
    urls = ["https://github.com/jmillikin/rust-linux-syscall/releases/download/v1.1.0/linux-syscall-1.1.0.tar.xz"],
)

To depend on linux-syscall from a Cargo workspace:

[dependencies]
linux-syscall = { version = "1.1.0" }

Dependencies

~53KB