Skip to main content

Syscall definitions and ABI for the WebAssembly Linux Interface (WALI)

Project description

wali

Syscall definitions and ABI type system for the WebAssembly Linux Interface (WALI).

This package is the machine-readable source of truth for all syscalls and auxillary methods (with arguments types, names, and per-architecture Linux syscall numbers). It also contains the ABI with exact byte-level layouts of all relevant types.

This package is intended for building WALI spec-related tooling: code generators, bindings, validators, documentation, etc.

Install

pip install wali-linux

Usage

from wali.spec import SYSCALLS, AUX_SYSCALLS, TypeRegistry

# Syscall metadata
read = SYSCALLS["read"]
read.nr                 # 0  (x86_64 number)
read.nrs.arm64          # 63
read.args               # ['int', 'void*', 'size_t']
read.args_id            # ['fd', 'buf', 'count']
read.implemented        # True

# ABI type layout
TypeRegistry.resolve_size("struct stat")       # 144
TypeRegistry.resolve_primitive("off_t")         # Primitive(size=8, signed=True)

stat = TypeRegistry.struct_defs["struct stat"]
for f, off, sz in zip(stat.fields, stat.field_offsets, stat.field_sizes):
    print(f"+{off:>3}  {f.name:<12} {f.type_name:<16} ({sz} bytes)")

Public API

Everything is importable from the wali.spec namespace.

Name Description
SYSCALLS dict[str, Syscall] of all defined Linux syscalls
AUX_SYSCALLS dict[str, AuxSyscall] of WALI auxiliary calls
Syscall, AuxSyscall, ArchNrs, SyscallArg syscall dataclasses
TypeRegistry ABI type system: primitives, aliases, arrays, structs, and layout resolution
Primitive, ArrayType, StructField type-system dataclasses

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wali_linux-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wali_linux-0.1.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file wali_linux-0.1.0.tar.gz.

File metadata

  • Download URL: wali_linux-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for wali_linux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c17c55d53e6db035720db09147c53cd8e8cd38db07df3a829dc12450fd40312
MD5 e473e2cb08cae5b13081ece0b8cf2b41
BLAKE2b-256 d562ca28e5cbc2a951c541755a791ed1e591cbd41eb92c391f6cc552bb6b4b8a

See more details on using hashes here.

File details

Details for the file wali_linux-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wali_linux-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for wali_linux-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7df39a7bce6913e3b89df8128ce4628598dc0518d8993eec3f4798822c5469f
MD5 908aa2ce278d43e6f58834b599133f0e
BLAKE2b-256 caa2db8f32205711aa300e87cc6cd6294c4584998341be2c6739d6763ffa73f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page