A small cross-platform Zig library to get the native stack base and size.
Linus Groh e649c76452
All checks were successful
CI / lint (push) Successful in 2m42s
CI / test (push) Successful in 3m8s
Update to Zig 0.15.2
2025-10-15 15:26:52 +02:00
.forgejo/workflows Update to Zig 0.15.2 2025-10-15 15:26:52 +02:00
src Add some documentation links 2025-09-02 20:52:08 +01:00
.gitignore zig-cache -> .zig-cache 2024-06-01 18:03:41 +02:00
build.zig Update for std.Build changes 2025-07-16 01:40:28 +01:00
build.zig.zon Update to Zig 0.15.2 2025-10-15 15:26:52 +02:00
LICENSE Initial commit 2024-05-10 22:28:17 +01:00
README.md Add workaround for musl 2024-05-12 12:27:44 +01:00

zig-stackinfo

A small cross-platform Zig library to get the native stack base and size.

API

pub const StackInfo = struct {
    base: usize,
    size: usize,

    pub const Error = error{ NotImplemented, PthreadError } || std.posix.UnexpectedError;

    pub fn init() Error!StackInfo {
        // ...
    }
};

Implemented platforms

  • FreeBSD
  • Haiku
  • Linux
  • macOS/iOS/watchOS/tvOS
  • NetBSD
  • OpenBSD
  • Solaris
  • Windows

Note that most of these have not been manually tested.