Skip to main content

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

Project description

WebAssembly Linux Interface

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

Specification-related information is available in the wali.spec namespace

Name Description
SYSCALLS dict[str, Syscall] of all defined Linux syscalls
AUX_SYSCALLS dict[str, AuxSyscall] of WALI auxiliary calls
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.2.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.2.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wali_linux-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 5ddba7ec043f1cc8fd28fe990c842b4db6cffc1e569ec8fa7a09d74a17b025fb
MD5 3ec59561886d9545be8c65ad6a39a4ea
BLAKE2b-256 813c8edbd3561fdaaf25748f15bc08ad220c80f7812bf4450aa41957c57d8e66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wali_linux-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e217547e8739ae1819e992a86e3b84ddaa8ef2973c436b822728cf59a7f6d7db
MD5 ea4f1858795f0e2621ae0e8fb411f83a
BLAKE2b-256 e5fb0bcf980594c54341c2ee7330bc31cbd892ecf2f47a8182ca3b904e06e4fc

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