From c922835c15c06fe0f4765bb5f4b2887b8a2827cc Mon Sep 17 00:00:00 2001 From: chao an Date: Sat, 7 Oct 2023 14:03:09 +0800 Subject: [PATCH] sys/types: supporting 32-bit IDs for gid_t/uid_t Signed-off-by: chao an --- include/sys/types.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/sys/types.h b/include/sys/types.h index 890c6d51a14c8..e2b0745ce686f 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -121,20 +121,27 @@ 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. */ -typedef int16_t uid_t; -typedef int16_t gid_t; +typedef unsigned int uid_t; +typedef unsigned int gid_t; + +#endif /* CONFIG_SMALL_MEMORY */ /* dev_t is used for device IDs */