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 <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2026-06-20 21:36:03 +08:00 committed by Matteo Golin
parent c13914c7b2
commit fa61c78c78
2 changed files with 8 additions and 13 deletions

View file

@ -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];

View file

@ -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;