-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-macosstandard 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.14.0
Steps to Reproduce and Observed Behavior
example code:
const std = @import("std");
const process = std.process;
// macOS: user not found but it does
pub fn main() !void {
const userInfo = try process.getUserInfo("gdc");
std.debug.print("uid: {}\ngid: {}\n", .{userInfo.uid, userInfo.gid});
}
And zig run
on macOS.
What I got:
[gdc@worldteam process] $ zig run getUserInfo.zig
error: UserNotFound
/opt/homebrew/Cellar/zig/0.14.0_2/lib/zig/std/process.zig:1647:33: 0x1048ab2db in posixGetUserInfo (getUserInfo)
if (amt_read < buf.len) return error.UserNotFound;
^
/opt/homebrew/Cellar/zig/0.14.0_2/lib/zig/std/process.zig:1529:5: 0x1048ab4d3 in getUserInfo (getUserInfo)
return switch (native_os) {
^
/Users/gdc/Repos/dacheng-zig/hello-zig/process/getUserInfo.zig:6:22: 0x1048ab567 in main (getUserInfo)
const userInfo = try process.getUserInfo("gdc");
Expected Behavior
return UserInfo
struct.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-macosstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.