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.1.1.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.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wali_linux-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 240ee4a7049894a43bb0fdabba19077358b3b8744c16ba71fd56a1360ae40597
MD5 42f272cfa2649ec86fce150d8d25671a
BLAKE2b-256 cade4feb715488d637a36b935dec1896c46f923ecf97f2ed272e96c37ba10ed9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wali_linux-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f725bcd166da37aa274d5712500debf6d5fcb61910293d68c85d57de94cbeb6e
MD5 5f5a7a40c9c1cd1ce1fecc45cb22e84e
BLAKE2b-256 9a761744090c1391b69768882494d7034e80988d8d50208ff2a14b09e71eceaf

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