Skip to content

Commit 08ad7d6

Browse files
authored
feature user for emscripten (#2496)
1 parent 062211b commit 08ad7d6

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Feature tests for OS functionality
22
pub use self::os::*;
33

4-
#[cfg(linux_android)]
4+
#[cfg(any(linux_android, target_os = "emscripten"))]
55
mod os {
66
use crate::sys::utsname::uname;
77
use crate::Result;

src/unistd.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,8 @@ pub fn setgroups(groups: &[Gid]) -> Result<()> {
19861986
target_os = "aix",
19871987
solarish,
19881988
apple_targets,
1989-
target_os = "redox"
1989+
target_os = "redox",
1990+
target_os = "emscripten",
19901991
)))]
19911992
pub fn getgrouplist(user: &CStr, group: Gid) -> Result<Vec<Gid>> {
19921993
let ngroups_max = match sysconf(SysconfVar::NGROUPS_MAX) {
@@ -2070,7 +2071,8 @@ pub fn getgrouplist(user: &CStr, group: Gid) -> Result<Vec<Gid>> {
20702071
#[cfg(not(any(
20712072
apple_targets,
20722073
target_os = "redox",
2073-
target_os = "haiku"
2074+
target_os = "haiku",
2075+
target_os = "emscripten",
20742076
)))]
20752077
pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
20762078
cfg_if! {
@@ -3492,6 +3494,7 @@ pub struct User {
34923494
target_os = "fuchsia",
34933495
target_os = "haiku",
34943496
target_os = "hurd",
3497+
target_os = "emscripten",
34953498
)))]
34963499
pub class: CString,
34973500
/// Last password change
@@ -3502,6 +3505,7 @@ pub struct User {
35023505
target_os = "fuchsia",
35033506
target_os = "haiku",
35043507
target_os = "hurd",
3508+
target_os = "emscripten",
35053509
)))]
35063510
pub change: libc::time_t,
35073511
/// Expiration time of account
@@ -3512,6 +3516,7 @@ pub struct User {
35123516
target_os = "fuchsia",
35133517
target_os = "haiku",
35143518
target_os = "hurd",
3519+
target_os = "emscripten",
35153520
)))]
35163521
pub expire: libc::time_t,
35173522
}
@@ -3565,6 +3570,7 @@ impl From<&libc::passwd> for User {
35653570
target_os = "fuchsia",
35663571
target_os = "haiku",
35673572
target_os = "hurd",
3573+
target_os = "emscripten",
35683574
)))]
35693575
class: CString::new(CStr::from_ptr(pw.pw_class).to_bytes())
35703576
.unwrap(),
@@ -3575,6 +3581,7 @@ impl From<&libc::passwd> for User {
35753581
target_os = "fuchsia",
35763582
target_os = "haiku",
35773583
target_os = "hurd",
3584+
target_os = "emscripten",
35783585
)))]
35793586
change: pw.pw_change,
35803587
#[cfg(not(any(
@@ -3584,6 +3591,7 @@ impl From<&libc::passwd> for User {
35843591
target_os = "fuchsia",
35853592
target_os = "haiku",
35863593
target_os = "hurd",
3594+
target_os = "emscripten",
35873595
)))]
35883596
expire: pw.pw_expire,
35893597
}
@@ -3625,6 +3633,7 @@ impl From<User> for libc::passwd {
36253633
target_os = "fuchsia",
36263634
target_os = "haiku",
36273635
target_os = "hurd",
3636+
target_os = "emscripten",
36283637
)))]
36293638
pw_class: u.class.into_raw(),
36303639
#[cfg(not(any(
@@ -3634,6 +3643,7 @@ impl From<User> for libc::passwd {
36343643
target_os = "fuchsia",
36353644
target_os = "haiku",
36363645
target_os = "hurd",
3646+
target_os = "emscripten",
36373647
)))]
36383648
pw_change: u.change,
36393649
#[cfg(not(any(
@@ -3643,6 +3653,7 @@ impl From<User> for libc::passwd {
36433653
target_os = "fuchsia",
36443654
target_os = "haiku",
36453655
target_os = "hurd",
3656+
target_os = "emscripten",
36463657
)))]
36473658
pw_expire: u.expire,
36483659
#[cfg(solarish)]

0 commit comments

Comments
 (0)