Skip to content

Commit a2d21d6

Browse files
p00falexrp
authored andcommitted
1 parent 0294e91 commit a2d21d6

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

lib/std/c.zig

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ pub const passwd = switch (native_os) {
204204
shell: ?[*:0]const u8, // default shell
205205
expire: time_t, // account expiration
206206
},
207+
.dragonfly, .freebsd => extern struct {
208+
name: ?[*:0]const u8, // user name
209+
passwd: ?[*:0]const u8, // encrypted password
210+
uid: uid_t, // user uid
211+
gid: gid_t, // user gid
212+
change: time_t, // password change time
213+
class: ?[*:0]const u8, // user access class
214+
gecos: ?[*:0]const u8, // Honeywell login info
215+
dir: ?[*:0]const u8, // home directory
216+
shell: ?[*:0]const u8, // default shell
217+
expire: time_t, // account expiration
218+
fields: c_int, // internal
219+
},
207220
else => void,
208221
};
209222

@@ -10271,9 +10284,13 @@ pub const fstatat = switch (native_os) {
1027110284
},
1027210285
else => private.fstatat,
1027310286
};
10274-
10287+
pub extern "c" fn getpwent() ?*passwd;
10288+
pub extern "c" fn endpwent() void;
10289+
pub extern "c" fn setpwent() void;
1027510290
pub extern "c" fn getpwnam(name: [*:0]const u8) ?*passwd;
10291+
pub extern "c" fn getpwnam_r(name: [*:0]const u8, pwd: *passwd, buf: [*]u8, buflen: usize, result: *?*passwd) c_int;
1027610292
pub extern "c" fn getpwuid(uid: uid_t) ?*passwd;
10293+
pub extern "c" fn getpwuid_r(uid: uid_t, pwd: *passwd, buf: [*]u8, buflen: usize, result: *?*passwd) c_int;
1027710294
pub extern "c" fn getgrent() ?*group;
1027810295
pub extern "c" fn setgrent() void;
1027910296
pub extern "c" fn endgrent() void;
@@ -11009,11 +11026,7 @@ pub const bcrypt = openbsd.bcrypt;
1100911026
pub const bcrypt_checkpass = openbsd.bcrypt_checkpass;
1101011027
pub const bcrypt_gensalt = openbsd.bcrypt_gensalt;
1101111028
pub const bcrypt_newhash = openbsd.bcrypt_newhash;
11012-
pub const endpwent = openbsd.endpwent;
11013-
pub const getpwent = openbsd.getpwent;
11014-
pub const getpwnam_r = openbsd.getpwnam_r;
1101511029
pub const getpwnam_shadow = openbsd.getpwnam_shadow;
11016-
pub const getpwuid_r = openbsd.getpwuid_r;
1101711030
pub const getpwuid_shadow = openbsd.getpwuid_shadow;
1101811031
pub const getthrid = openbsd.getthrid;
1101911032
pub const login_cap_t = openbsd.login_cap_t;
@@ -11030,7 +11043,6 @@ pub const pthread_spinlock_t = openbsd.pthread_spinlock_t;
1103011043
pub const pw_dup = openbsd.pw_dup;
1103111044
pub const setclasscontext = openbsd.setclasscontext;
1103211045
pub const setpassent = openbsd.setpassent;
11033-
pub const setpwent = openbsd.setpwent;
1103411046
pub const setusercontext = openbsd.setusercontext;
1103511047
pub const uid_from_user = openbsd.uid_from_user;
1103611048
pub const unveil = openbsd.unveil;

lib/std/c/openbsd.zig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ pub extern "c" fn auth_checknologin(lc: *login_cap_t) void;
8181

8282
pub extern "c" fn getpwuid_shadow(uid: uid_t) ?*passwd;
8383
pub extern "c" fn getpwnam_shadow(name: [*:0]const u8) ?*passwd;
84-
pub extern "c" fn getpwnam_r(name: [*:0]const u8, pw: *passwd, buf: [*]u8, buflen: usize, pwretp: *?*passwd) c_int;
85-
pub extern "c" fn getpwuid_r(uid: uid_t, pw: *passwd, buf: [*]u8, buflen: usize, pwretp: *?*passwd) c_int;
86-
pub extern "c" fn getpwent() ?*passwd;
87-
pub extern "c" fn setpwent() void;
88-
pub extern "c" fn endpwent() void;
8984
pub extern "c" fn setpassent(stayopen: c_int) c_int;
9085
pub extern "c" fn uid_from_user(name: [*:0]const u8, uid: *uid_t) c_int;
9186
pub extern "c" fn user_from_uid(uid: uid_t, noname: c_int) ?[*:0]const u8;

0 commit comments

Comments
 (0)