-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-linuxLinuxLinuxstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Zig Version
0.9.1
Steps to Reproduce
const std = @import("std");
const c = @cImport({
@cInclude("sys/stat.h");
});
pub fn main() anyerror!void {
var stbuf: c.struct_stat = undefined;
const ret = c.lstat("/no/exist/path", &stbuf);
std.debug.print("ret = {}, c.errno = {}\n", .{ ret, std.c._errno().* });
}
Expected Behavior
The output should be: ret = -1, c.errno = 2.
Actual Behavior
But the actual output is ret = -1, c.errno = 0. The errno is not set correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-linuxLinuxLinuxstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.