From ec9ea2242ff6fa06126084b35f6a55140728e05b Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Thu, 26 Dec 2024 16:11:39 +0800 Subject: [PATCH 1/2] feat: add pw_passwd field to passwd struct in NuttX Signed-off-by: Huang Qi --- src/unix/nuttx/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/unix/nuttx/mod.rs b/src/unix/nuttx/mod.rs index bf6efdd7ae362..b17c00307dba2 100644 --- a/src/unix/nuttx/mod.rs +++ b/src/unix/nuttx/mod.rs @@ -54,6 +54,7 @@ s! { pub struct passwd { pub pw_name: *const c_char, + pub pw_passwd: *const c_char, pub pw_uid: u32, pub pw_gid: u32, pub pw_gecos: *const c_char, @@ -247,6 +248,7 @@ s! { // for example, struct passwd, https://pubs.opengroup.org/onlinepubs/009695399/basedefs/pwd.h.html, // POSIX only defines following fields in struct passwd: // char *pw_name User's login name. +// char *pw_passwd Encrypted password. // uid_t pw_uid Numerical user ID. // gid_t pw_gid Numerical group ID. // char *pw_dir Initial working directory. From cb668df8ba18319a91716c12f76bbc5e287ae861 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Thu, 26 Dec 2024 16:11:53 +0800 Subject: [PATCH 2/2] fix: update tm_zone and d_name fields to use c_char type in NuttX Signed-off-by: Huang Qi --- src/unix/nuttx/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix/nuttx/mod.rs b/src/unix/nuttx/mod.rs index b17c00307dba2..b710746833ced 100644 --- a/src/unix/nuttx/mod.rs +++ b/src/unix/nuttx/mod.rs @@ -129,7 +129,7 @@ s! { pub tm_yday: i32, pub tm_isdst: i32, pub tm_gmtoff: isize, - pub tm_zone: *const i8, + pub tm_zone: *const c_char, __reserved: [usize; __DEFAULT_RESERVED_SIZE__], } @@ -166,7 +166,7 @@ s! { pub struct dirent { pub d_type: u8, - pub d_name: [i8; __NAME_MAX__ + 1], + pub d_name: [c_char; __NAME_MAX__ + 1], } pub struct fd_set {