Zig’s os.read() is a layer of abstraction over the underlying os.system.read(). If you use the underlying method then you can use os.errno() and if you link to libc then use c.strerror() just the same. But it’s really just a libc concept, so there’s no direct equivalent that I know of.
Glad you got it working as you wanted. You could check out the std.log module for “proper” logging, as std.debug.print is meant mostly for “print debugging”. Also @src() could give you the equivalent of c’s __func__ macro (and a few more), if you wanted some more similarity to the original message format.
Yes, I know about log namespace, thanx anyway. The point is that learning standard (or any other) library is separate part and as a rule this part is much bigger than learning a language itself (syntax, concepts…). For the moment std.debug.print is more than enough for me.
No, I just wanted some equivalent for “no such file or directory”, “connection refused” and so on… FileNotFound, ConnectionRefused (and so on) are quite well suited for that.