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

Uploaded Python 3

File details

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

File metadata

  • Download URL: wali_linux-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 503c10bdc49dd9010e766e6d98bb2e11915f6bb54761caa9ae41380a5826d48c
MD5 01e660750ba76ef54875a8a7f86fba8d
BLAKE2b-256 f7f75d086bceb76cecd625155c1ce81fe3a35c1a5e5278f72ff01b66e9c3b71f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wali_linux-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f13cdfe3862ff2429ec051cd4d7ae93c1f15db14696066b260c5788a83e94f7
MD5 e33fab40e8cf5e7153dae60a432e146d
BLAKE2b-256 3595618aaba7b87839f4d032c4439cc160361533dc6aac85ac063ff039c4ebd6

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