xiaoxiang781216 commented on code in PR #19767:
URL: https://github.com/apache/nuttx/pull/19767#discussion_r3764269445


##########
include/sys/types.h:
##########
@@ -135,9 +136,61 @@ typedef _size_t      rsize_t;
  * gid_t is used for group IDs.
  */
 
+#ifdef CONFIG_SMALL_MEMORY
+
+typedef int16_t      uid_t;
+typedef int16_t      gid_t;
+
+#else /* CONFIG_SMALL_MEMORY */
+
 typedef unsigned int uid_t;
 typedef unsigned int gid_t;
 
+#endif /* CONFIG_SMALL_MEMORY */
+
+#ifndef __ASSEMBLY__
+
+/****************************************************************************
+ * Name: uid_valid / gid_valid
+ *
+ * Description:
+ *   Return true if the UID/GID is in the range supported on this platform.
+ *   On CONFIG_SMALL_MEMORY builds uid_t/gid_t are int16_t and negative
+ *   values are invalid.  Otherwise uid_t/gid_t are unsigned int and any
+ *   value is accepted (setresuid/setresgid still treat (uid_t)-1 specially).
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SMALL_MEMORY

Review Comment:
   should we move to private header file to avoid pollute the public header file



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to