xiaoxiang781216 commented on code in PR #20531:
URL: https://github.com/apache/nuttx/pull/20531#discussion_r4225922643
##########
libs/libc/unistd/lib_getlogin.c:
##########
@@ -0,0 +1,113 @@
+/****************************************************************************
+ * libs/libc/unistd/lib_getlogin.c
Review Comment:
should we move to libs/libc/pwd/lib_getpwuidr.c
##########
include/unistd.h:
##########
@@ -399,6 +401,13 @@ int isatty(int fd);
FAR char *ttyname(int fd);
int ttyname_r(int fd, FAR char *buf, size_t buflen);
+/* Legacy BSD interfaces, as functions so that a program may declare them */
+
+#ifdef CONFIG_LIBC_GETPAGESIZE_FUNCTIONS
Review Comment:
remove CONFIG_LIBC_GETPAGESIZE_FUNCTIONS, it doesn't make sense to add an
option to select macro/function
##########
libs/libc/unistd/Kconfig:
##########
@@ -111,6 +111,13 @@ config LIBC_HOSTNAME
---help---
A unique name to identify device on the network
+config LIBC_GETLOGIN
Review Comment:
why not reuse LIBC_PASSWD_FILE
##########
libs/libc/grp/lib_getgrent.c:
##########
@@ -0,0 +1,109 @@
+/****************************************************************************
+ * libs/libc/grp/lib_getgrent.c
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <grp.h>
+
+#include "grp/lib_grp.h"
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* Index of the next entry that getgrent() returns */
+
+static int g_group_index;
Review Comment:
move to task_info_s?
##########
libs/libc/grp/Make.defs:
##########
@@ -31,6 +31,10 @@ else
CSRCS += lib_getgrbuf.c lib_getgrbufr.c
endif
+ifeq ($(CONFIG_LIBC_GETGRENT),y)
+CSRCS += lib_getgrent.c
Review Comment:
merge to line 26
##########
include/grp.h:
##########
@@ -63,6 +63,11 @@ extern "C"
FAR struct group *getgrnam(FAR const char *name);
FAR struct group *getgrgid(gid_t gid);
+#ifdef CONFIG_LIBC_GETGRENT
Review Comment:
remove CONFIG_LIBC_GETGRENT, since if the user doesn't call these new
functions, linker could remove them from the final image.
##########
libs/libc/grp/CMakeLists.txt:
##########
@@ -28,4 +28,8 @@ else()
list(APPEND SRCS lib_getgrbuf.c lib_getgrbufr.c)
endif()
+if(CONFIG_LIBC_GETGRENT)
+ list(APPEND SRCS lib_getgrent.c)
Review Comment:
merge to line 22
--
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]