This is an automated email from the ASF dual-hosted git repository.

linguini1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit fa61c78c78349ef8a5ddc49df45f3bb6d69e9138
Author: Xiang Xiao <[email protected]>
AuthorDate: Sat Jun 20 21:36:03 2026 +0800

    sys/types: always use unsigned int for uid_t/gid_t
    
    Move uid_t/gid_t out of the CONFIG_SMALL_MEMORY #ifdef so they are
    always defined as unsigned int regardless of SMALL_MEMORY.
    
    Update include/nuttx/fs/hostfs.h to match: drop the int16_t variants
    of nuttx_gid_t/nuttx_uid_t and keep a single unsigned int definition
    so the hostfs RPC ABI stays in sync with sys/types.h.
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 include/nuttx/fs/hostfs.h | 10 ++++++----
 include/sys/types.h       | 11 ++---------
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/include/nuttx/fs/hostfs.h b/include/nuttx/fs/hostfs.h
index 92c611e8b03..65d0c1dd83a 100644
--- a/include/nuttx/fs/hostfs.h
+++ b/include/nuttx/fs/hostfs.h
@@ -110,20 +110,21 @@
 /* These must match the definitions in include/sys/types.h */
 
 typedef int16_t      nuttx_blksize_t;
+
 #  ifdef CONFIG_SMALL_MEMORY
-typedef int16_t      nuttx_gid_t;
-typedef int16_t      nuttx_uid_t;
 typedef uint16_t     nuttx_size_t;
 typedef int16_t      nuttx_ssize_t;
 #  else /* CONFIG_SMALL_MEMORY */
-typedef unsigned int nuttx_gid_t;
-typedef unsigned int nuttx_uid_t;
 typedef uintptr_t    nuttx_size_t;
 typedef intptr_t     nuttx_ssize_t;
 #  endif /* CONFIG_SMALL_MEMORY */
+
+typedef unsigned int nuttx_gid_t;
+typedef unsigned int nuttx_uid_t;
 typedef uint32_t     nuttx_dev_t;
 typedef uint16_t     nuttx_ino_t;
 typedef uint16_t     nuttx_nlink_t;
+
 #  ifdef CONFIG_FS_LARGEFILE
 typedef int64_t      nuttx_off_t;
 typedef uint64_t     nuttx_blkcnt_t;
@@ -131,6 +132,7 @@ typedef uint64_t     nuttx_blkcnt_t;
 typedef int32_t      nuttx_off_t;
 typedef uint32_t     nuttx_blkcnt_t;
 #  endif
+
 typedef unsigned int nuttx_mode_t;
 typedef int          nuttx_fsid_t[2];
 
diff --git a/include/sys/types.h b/include/sys/types.h
index 0836db8feb3..02ed42b08e6 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -123,19 +123,14 @@ typedef uint16_t     size_t;
 typedef int16_t      ssize_t;
 typedef uint16_t     rsize_t;
 
-/* uid_t is used for user IDs
- * gid_t is used for group IDs.
- */
-
-typedef int16_t      uid_t;
-typedef int16_t      gid_t;
-
 #else /* CONFIG_SMALL_MEMORY */
 
 typedef _size_t      size_t;
 typedef _ssize_t     ssize_t;
 typedef _size_t      rsize_t;
 
+#endif /* CONFIG_SMALL_MEMORY */
+
 /* uid_t is used for user IDs
  * gid_t is used for group IDs.
  */
@@ -143,8 +138,6 @@ typedef _size_t      rsize_t;
 typedef unsigned int uid_t;
 typedef unsigned int gid_t;
 
-#endif /* CONFIG_SMALL_MEMORY */
-
 /* dev_t is used for device IDs */
 
 typedef uint32_t     dev_t;

Reply via email to