1个稳定版本
1.0.0 | 2022年9月10日 |
---|
#571 in Unix API
每月704次下载
105KB
2.5K SLoC
Rust的Linux系统调用宏
此库定义了系统调用编号和用于直接调用Linux系统调用的syscall!
宏。
架构模块文档列出了所有支持的架构的可用的系统调用编号,顶级模块重新导出当前目标平台的系统调用编号。
支持的架构
aarch64
arm
riscv64
x86
x86_64
要由本库支持,一个架构必须
- 拥有由Rust工具链支持的二等或更好级别的
*-linux-*
目标,并且 - 拥有稳定的
asm!
宏(https://github.com/rust-lang/rust/issues/93335)。
从Bazel工作空间依赖linux-syscall
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.0.0
sha256 = "",
strip_prefix = "linux-syscall-1.0.0",
urls = ["https://github.com/jmillikin/rust-linux-syscall/releases/download/v1.0.0/linux-syscall-1.0.0.tar.xz"],
)
从Cargo工作空间依赖linux-syscall
[dependencies]
linux-syscall = { version = "1.0.0" }
依赖
~53KB