# \#standard-library

**URL:** https://ziggit.dev/tag/standard-library/17.md?match_all_tags=true&tags%5B%5D=standard-library

[Latest](https://ziggit.dev/latest.md) · [Categories](https://ziggit.dev/categories.md) · [Tags](https://ziggit.dev/tags.md)

---

## [How to let build time generated zig module import src/ relative modules](https://ziggit.dev/t/how-to-let-build-time-generated-zig-module-import-src-relative-modules/18269)

<div class="topic-metadata">

**Author:** [@korke](https://ziggit.dev/u/korke)\
**Replies:** 4\
**Last updated:** [November 8, 2026, 2:22am UTC](https://ziggit.dev/t/how-to-let-build-time-generated-zig-module-import-src-relative-modules/18269 "2026-11-08T02:22:49Z")

</div>

I was trying to do something like this: src/root.zig: pub export fn init(...) bool { } during build time I can accumulate all the src/ relative .zig file based on some logic. const generate\_root = b.addExecutab…

---

## [Getting the length of the stdin buffer on Linux](https://ziggit.dev/t/getting-the-length-of-the-stdin-buffer-on-linux/18178)

<div class="topic-metadata">

**Author:** [@Forseti](https://ziggit.dev/u/Forseti)\
**Replies:** 7\
**Last updated:** [November 7, 2026, 9:36am UTC](https://ziggit.dev/t/getting-the-length-of-the-stdin-buffer-on-linux/18178 "2026-11-07T09:36:05Z")

</div>

Hello everyone, i am new to zig and as a learning project i decided to work on my own posix utilities. Currently working on cat and i am using the following code to write the stdin content to stdout: const stdin =…

---

## [Cross-compile for macos fails with "undefined symbol \_ppoll" (works with posix.poll)](https://ziggit.dev/t/cross-compile-for-macos-fails-with-undefined-symbol-ppoll-works-with-posix-poll/18230)

<div class="topic-metadata">

**Author:** [@lukeflo](https://ziggit.dev/u/lukeflo)\
**Replies:** 4\
**Last updated:** [November 5, 2026, 8:07pm UTC](https://ziggit.dev/t/cross-compile-for-macos-fails-with-undefined-symbol-ppoll-works-with-posix-poll/18230 "2026-11-05T20:07:32Z")

</div>

With the help of user @Wunka I recently added support for capturing SIGWINCH resize signals while waiting on an input event for my TUI lib dabeob. The solution uses std.posix.ppoll to wait for an input event OR a SIGWINC…

---

## [MEDIA\_CHANGED error on Window (network)](https://ziggit.dev/t/media-changed-error-on-window-network/18185)

<div class="topic-metadata">

**Author:** [@yinameah](https://ziggit.dev/u/yinameah)\
**Replies:** 3\
**Last updated:** [November 3, 2026, 3:37pm UTC](https://ziggit.dev/t/media-changed-error-on-window-network/18185 "2026-11-03T15:37:02Z")

</div>

Hello, I’m hitting an issue on Windows while trying to setup a local web server. error.Unexpected NTSTATUS=0x8000001c (MEDIA\_CHANGED) C:\\Users\\cibrario\\scoop\\persist\\zigup\\zig\\0.17.0\\files\\lib\\std\\Io\\Threaded.zig:1462:…

---

## [Is it still planned for main to get a second argument or is this an outdated idea?](https://ziggit.dev/t/is-it-still-planned-for-main-to-get-a-second-argument-or-is-this-an-outdated-idea/18192)

<div class="topic-metadata">

**Author:** [@THE\_DRINK](https://ziggit.dev/u/THE_DRINK)\
**Replies:** 1\
**Last updated:** [November 2, 2026, 11:17pm UTC](https://ziggit.dev/t/is-it-still-planned-for-main-to-get-a-second-argument-or-is-this-an-outdated-idea/18192 "2026-11-02T23:17:55Z")

</div>

while i was reading some docs a came across https://codeberg.org/ziglang/zig/src/commit/aca58dd61a80f8bfe162ee9f715a605b4066f9c0/lib/std/process.zig#L28-L30 which implies that main would take a second argument is there…

---

## [Can you build a binary for Windows 7?](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184)

<div class="topic-metadata">

**Author:** [@Robert.Buch](https://ziggit.dev/u/Robert.Buch)\
**Replies:** 5\
**Last updated:** [November 2, 2026, 6:32pm UTC](https://ziggit.dev/t/can-you-build-a-binary-for-windows-7/18184 "2026-11-02T18:32:58Z")

</div>

I want to make a tool for a friend who is still on Windows 7. (Reads some folders/files, analyses them, prints results, done.) Yes, we all know that anything older than Windows 11 is no longer supported by Microsoft. No,…

---

## [Allow swallow in checkAllAllocationFailures?](https://ziggit.dev/t/allow-swallow-in-checkallallocationfailures/18187)

<div class="topic-metadata">

**Author:** [@dennypenta](https://ziggit.dev/u/dennypenta)\
**Replies:** 1\
**Last updated:** [November 2, 2026, 5:49pm UTC](https://ziggit.dev/t/allow-swallow-in-checkallallocationfailures/18187 "2026-11-02T17:49:02Z")

</div>

There is a very useful thing checkAllAllocationFailures. but it has a limitation: If my code ignores OOM and doesn’t proxy it up, it gives an error that OOM is swallowed. Apparently it is very easy to face such a case…

---

## [\`std.DoublyLinkedList\` with nodes created out of scope](https://ziggit.dev/t/std-doublylinkedlist-with-nodes-created-out-of-scope/18186)

<div class="topic-metadata">

**Author:** [@devanbenz](https://ziggit.dev/u/devanbenz)\
**Replies:** 5\
**Last updated:** [November 2, 2026, 4:04pm UTC](https://ziggit.dev/t/std-doublylinkedlist-with-nodes-created-out-of-scope/18186 "2026-11-02T16:04:51Z")

</div>

With Zig’s std.DoublyLinkedList how can I access elements that are inserted outside of the function scope? For example I have the following code where I’m playing around with std.DoublyLinkedList while attempting to impl…

---

## [std.crypto.tls.Client Hangs](https://ziggit.dev/t/std-crypto-tls-client-hangs/18112)

<div class="topic-metadata">

**Author:** [@nik.marinov](https://ziggit.dev/u/nik.marinov)\
**Replies:** 14\
**Last updated:** [November 1, 2026, 4:45am UTC](https://ziggit.dev/t/std-crypto-tls-client-hangs/18112 "2026-11-01T04:45:23Z")

</div>

Hi all, I might be misunderstanding the reader/writer interfaces, but I’m not entirely sure what I’m doing wrong when trying to connect using tls.Client. Could someone take a look and point me in the right direction? T…

---

## [Unexpected sendFile() performance behavior](https://ziggit.dev/t/unexpected-sendfile-performance-behavior/18141)

<div class="topic-metadata">

**Author:** [@Bobvan](https://ziggit.dev/u/Bobvan)\
**Replies:** 10\
**Last updated:** [October 30, 2026, 11:40am UTC](https://ziggit.dev/t/unexpected-sendfile-performance-behavior/18141 "2026-10-30T11:40:59Z")

</div>

Hello, I have been playing around with implementing cat-like utility (mostly to help other people learn). While doing so i encountered interesting performance characteristic of sendFile() on linux. I will focus on …

---

## [RadDebugger and Zig](https://ziggit.dev/t/raddebugger-and-zig/17826)

<div class="topic-metadata">

**Author:** [@igors84](https://ziggit.dev/u/igors84)\
**Replies:** 14\
**Last updated:** [October 30, 2026, 2:01am UTC](https://ziggit.dev/t/raddebugger-and-zig/17826 "2026-10-30T02:01:49Z")

</div>

Now that RadDebugger (alpha) is available for Linux I gave it a try on my Zig project. It is incredibly fast and smooth but I couldn’t find a way to make it usable with Zig types. I immediately went to see how will it ha…

---

## [Weird SafeAllocator issue causing stack overflow](https://ziggit.dev/t/weird-safeallocator-issue-causing-stack-overflow/18137)

<div class="topic-metadata">

**Author:** [@senjosei](https://ziggit.dev/u/senjosei)\
**Replies:** 1\
**Last updated:** [October 30, 2026, 12:27am UTC](https://ziggit.dev/t/weird-safeallocator-issue-causing-stack-overflow/18137 "2026-10-30T00:27:11Z")

</div>

I encountered this weird issue and is still trying to understand it to make a minimal reproducable repo but writing it here incase im dumm and the issue is something else. Im making this What's everybody working on? (Oct…

---

## [Is there a way to get a debug writer?](https://ziggit.dev/t/is-there-a-way-to-get-a-debug-writer/18140)

<div class="topic-metadata">

**Author:** [@Solarflurry](https://ziggit.dev/u/Solarflurry)\
**Replies:** 2\
**Last updated:** [October 29, 2026, 11:51am UTC](https://ziggit.dev/t/is-there-a-way-to-get-a-debug-writer/18140 "2026-10-29T11:51:35Z")

</div>

Is there a way to get a debug writer, similar to what std.debug.print does, but more generically as an entire writer? This is just to print information when I don’t have access to a writer. Something like this: printSom…

---

## [How are you meant to use Select.async correctly?](https://ziggit.dev/t/how-are-you-meant-to-use-select-async-correctly/18129)

<div class="topic-metadata">

**Author:** [@InspectorBoat](https://ziggit.dev/u/InspectorBoat)\
**Replies:** 4\
**Last updated:** [October 29, 2026, 1:03am UTC](https://ziggit.dev/t/how-are-you-meant-to-use-select-async-correctly/18129 "2026-10-29T01:03:35Z")

</div>

The implementation is allowed to run the task eagerly, blocking the calling thread before the Select.async() call even returns The task has to append its completion value to a blocking queue before it can finishes The q…

---

## [Memory leak with BufMap](https://ziggit.dev/t/memory-leak-with-bufmap/18132)

<div class="topic-metadata">

**Author:** [@exfalsoquodlibet](https://ziggit.dev/u/exfalsoquodlibet)\
**Replies:** 2\
**Last updated:** [October 28, 2026, 9:16pm UTC](https://ziggit.dev/t/memory-leak-with-bufmap/18132 "2026-10-28T21:16:01Z")

</div>

Hi :slight\_smile: My understanding of the documentation of BufMap is that the deinit should take care of freeing all the entries (keys and values) along with the backing storage (it’s also my understanding of its implem…

---

## [Trying to serialize a struct to JSON leads to a Segmentation fault](https://ziggit.dev/t/trying-to-serialize-a-struct-to-json-leads-to-a-segmentation-fault/18116)

<div class="topic-metadata">

**Author:** [@std.up](https://ziggit.dev/u/std.up)\
**Replies:** 3\
**Last updated:** [October 28, 2026, 8:03pm UTC](https://ziggit.dev/t/trying-to-serialize-a-struct-to-json-leads-to-a-segmentation-fault/18116 "2026-10-28T20:03:29Z")

</div>

Zig version: 0.17 Hi there, I am learning Zig and my first serious project is to implement a small app that gets a payload from the job queue and posts it to Slack API. The API works with the concept of “blocks”, each b…

---

## [New to Zig, and systems programming. What am I doing wrong here?](https://ziggit.dev/t/new-to-zig-and-systems-programming-what-am-i-doing-wrong-here/17971)

<div class="topic-metadata">

**Author:** [@willp223](https://ziggit.dev/u/willp223)\
**Replies:** 27\
**Last updated:** [October 27, 2026, 3:36am UTC](https://ziggit.dev/t/new-to-zig-and-systems-programming-what-am-i-doing-wrong-here/17971 "2026-10-27T03:36:27Z")

</div>

Hey Everyone, I am an “AI” Engineer (AI tooling). Most of my experience is in Python, and Typescript. Looking to escape web dev hell so I am learning zig! I have done all of this without AI pretty much which is a pretty…

---

## [Am I using Io.failing wrong?](https://ziggit.dev/t/am-i-using-io-failing-wrong/18091)

<div class="topic-metadata">

**Author:** [@truly-not-taken](https://ziggit.dev/u/truly-not-taken)\
**Replies:** 3\
**Last updated:** [October 25, 2026, 8:32am UTC](https://ziggit.dev/t/am-i-using-io-failing-wrong/18091 "2026-10-25T08:32:20Z")

</div>

This test spins in an infinite loop: test "failing Io fails to flush in positional mode" { var buffer: \[128\]u8 = undefined; var stdout: std.Io.File.Writer = .init(.stdout(), .failing, &buffer); try stdout.in…

---

## [Zp - A source-based package manager written in Zig](https://ziggit.dev/t/zp-a-source-based-package-manager-written-in-zig/17473)

<div class="topic-metadata">

**Author:** [@nevvixsz](https://ziggit.dev/u/nevvixsz)\
**Replies:** 5\
**Last updated:** [October 24, 2026, 5:14pm UTC](https://ziggit.dev/t/zp-a-source-based-package-manager-written-in-zig/17473 "2026-10-24T17:14:05Z")

</div>

Hello Zig community. I want to share my project zp, a minimal source-based package manager written in Zig. It is inspired by CRUX, KISS Linux, and Void xbps-src. Instead of downloading prebuilt binaries, zp fetches the …

---

## [Initializing arguments to @call during comptime](https://ziggit.dev/t/initializing-arguments-to-call-during-comptime/18058)

<div class="topic-metadata">

**Author:** [@kapusta](https://ziggit.dev/u/kapusta)\
**Replies:** 1\
**Last updated:** [October 22, 2026, 6:26pm UTC](https://ziggit.dev/t/initializing-arguments-to-call-during-comptime/18058 "2026-10-22T18:26:11Z")

</div>

HELLO, I want to write down some comptime wrapper for zig functions to be converted into lua CFunctions, but Im stuck with constructing argument object for @call. For now i try to do something like: const info = @type…

---

## [Exploring the idea of a more modular alternative design to \`std.mem.Allocator\`](https://ziggit.dev/t/exploring-the-idea-of-a-more-modular-alternative-design-to-std-mem-allocator/17589)

<div class="topic-metadata">

**Author:** [@kirisoup](https://ziggit.dev/u/kirisoup)\
**Replies:** 40\
**Last updated:** [October 21, 2026, 10:44am UTC](https://ziggit.dev/t/exploring-the-idea-of-a-more-modular-alternative-design-to-std-mem-allocator/17589 "2026-10-21T10:44:31Z")

</div>

The thing that inspired this post: I remember reading a blog post from matklad (IIRC that is, I can’t find it unfortunately), which introduced me to the concept of using arena v.s. gpa to manage the lifetime of internal …

---

## ["{q}" prints strings nicely but what about a single character?](https://ziggit.dev/t/q-prints-strings-nicely-but-what-about-a-single-character/18033)

<div class="topic-metadata">

**Author:** [@truly-not-taken](https://ziggit.dev/u/truly-not-taken)\
**Replies:** 2\
**Last updated:** [October 20, 2026, 7:41am UTC](https://ziggit.dev/t/q-prints-strings-nicely-but-what-about-a-single-character/18033 "2026-10-20T07:41:40Z")

</div>

test "print u8 with {q}" { const expected: u8 = 'a'; const actual: u8 = '\\t'; // this does not compile // errdefer std.debug.print("expected {q}, found {q}\\n", .{ // expected, // actual, …

---

## [Mind reviewing my x402 core library?](https://ziggit.dev/t/mind-reviewing-my-x402-core-library/17979)

<div class="topic-metadata">

**Author:** [@Monjuik](https://ziggit.dev/u/Monjuik)\
**Replies:** 3\
**Last updated:** [October 16, 2026, 5:57am UTC](https://ziggit.dev/t/mind-reviewing-my-x402-core-library/17979 "2026-10-16T05:57:42Z")

</div>

Could you please review my x402 core library? x402 provides possibility to request (small) payments for accessing your web-server. I’ve been writing it for the last few weeks. Code style-wise I follow examples from Zig s…

---

## [Is preventing the propagation of \`try\` usually a good idea?](https://ziggit.dev/t/is-preventing-the-propagation-of-try-usually-a-good-idea/17982)

<div class="topic-metadata">

**Author:** [@zwynd](https://ziggit.dev/u/zwynd)\
**Replies:** 4\
**Last updated:** [October 16, 2026, 1:42am UTC](https://ziggit.dev/t/is-preventing-the-propagation-of-try-usually-a-good-idea/17982 "2026-10-16T01:42:02Z")

</div>

Over time, I’ve found that there’s a lot of APIs in Zig that constantly return errors I can’t really do anything about if they happen. error.OutOfMemory is an example, and error.WriteFailed is another. When writing a li…

---

## [File I/O basics (0.16)](https://ziggit.dev/t/file-i-o-basics-0-16/14968)

<div class="topic-metadata">

**Author:** [@jmctagger](https://ziggit.dev/u/jmctagger)\
**Replies:** 26\
**Last updated:** [October 14, 2026, 2:24am UTC](https://ziggit.dev/t/file-i-o-basics-0-16/14968 "2026-10-14T02:24:20Z")

</div>

(Note, this is a variation on this article, invited into docs with the release of 0.16.) As always, reply/comment all you want, and I’ll endeavor to make changes accordingly. Motivation, and migration Zig 0.16 brought …

---

## [How to free allocated slice partially?](https://ziggit.dev/t/how-to-free-allocated-slice-partially/17930)

<div class="topic-metadata">

**Author:** [@hizani](https://ziggit.dev/u/hizani)\
**Replies:** 7\
**Last updated:** [October 13, 2026, 7:37pm UTC](https://ziggit.dev/t/how-to-free-allocated-slice-partially/17930 "2026-10-13T19:37:52Z")

</div>

test "example" { const buf = try std.heap.page\_allocator.alloc(u8, 10); std.heap.page\_allocator.free(buf\[5..\]); } This test panics with incorrect alignment error. I also tried rawFree with different alignments, …

---

## [Way to get current working directory in \`Io\`](https://ziggit.dev/t/way-to-get-current-working-directory-in-io/17921)

<div class="topic-metadata">

**Author:** [@zeeqeeng](https://ziggit.dev/u/zeeqeeng)\
**Replies:** 8\
**Last updated:** [October 12, 2026, 3:14am UTC](https://ziggit.dev/t/way-to-get-current-working-directory-in-io/17921 "2026-10-12T03:14:58Z")

</div>

I’m learning the Io interface and be trying to find some C function equivalents, for example, the getcwd(3) C function, to make a tiny program behaves like the pwd(1) utility. I tried two approaches, first std.c.getcwd(),…

---

## [Error when using \`discardRemaining()\`](https://ziggit.dev/t/error-when-using-discardremaining/17898)

<div class="topic-metadata">

**Author:** [@nrv30](https://ziggit.dev/u/nrv30)\
**Replies:** 3\
**Last updated:** [October 11, 2026, 9:56pm UTC](https://ziggit.dev/t/error-when-using-discardremaining/17898 "2026-10-11T21:56:44Z")

</div>

Hi I’m a complete beginner in zig. I’m trying to make a simple REPL program but I’m running into an error when I use the discardRemaining() function for the reader. I’m looking for some help to get it working, I have pro…

---

## [Why no builtin string type?](https://ziggit.dev/t/why-no-builtin-string-type/5326)

<div class="topic-metadata">

**Author:** [@Karim.MK](https://ziggit.dev/u/Karim.MK)\
**Replies:** 9\
**Last updated:** [October 11, 2026, 8:56am UTC](https://ziggit.dev/t/why-no-builtin-string-type/5326 "2026-10-11T08:56:29Z")

</div>

Hi, quick question. why zig doesn’t have a builtin with UTF-8 encoding? I know there is zig-string, but strings are one of the most basic types in a modern language. is it something that can be added later, or the zig …

---

## [State of networking in \`std.Io\`](https://ziggit.dev/t/state-of-networking-in-std-io/16553)

<div class="topic-metadata">

**Author:** [@lalinsky](https://ziggit.dev/u/lalinsky)\
**Replies:** 44\
**Last updated:** [October 11, 2026, 3:57am UTC](https://ziggit.dev/t/state-of-networking-in-std-io/16553 "2026-10-11T03:57:20Z")

</div>

I’ve been writing about this in the past, but after the 0.16 release, things already got worse. The interface is missing several key features, that people are hacking around, tying to a particular std.Io implementation, …

[Next page](https://ziggit.dev/tag/standard-library/17.md?match_all_tags=true&page=1&tags%5B%5D=standard-library)
