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


##########
libs/libc/stdlib/lib_getloadavg.c:
##########
@@ -0,0 +1,63 @@
+/****************************************************************************
+ * libs/libc/stdlib/lib_getloadavg.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 <stdlib.h>
+
+#ifdef CONFIG_HAVE_DOUBLE
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: getloadavg
+ *
+ * Description:
+ *   Get the number of processes in the run queue, averaged over the last
+ *   1, 5 and 15 minutes (the BSD and Linux function).  NuttX does not keep
+ *   these averages, so the load average is not available.
+ *
+ * Input Parameters:
+ *   loadavg - The array for the averages
+ *   nelem   - The number of averages to get (at most 3)
+ *
+ * Returned Value:
+ *   -1: the load average is not available.  Programs that can use the
+ *   load average take -1 as "unknown" (as on a system without
+ *   /proc/loadavg).
+ *
+ ****************************************************************************/
+
+int getloadavg(FAR double loadavg[], int nelem)

Review Comment:
   how about clock_cpuload



##########
libs/libc/unistd/lib_getusershell.c:
##########
@@ -0,0 +1,149 @@
+/****************************************************************************
+ * libs/libc/unistd/lib_getusershell.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 <ctype.h>
+#include <paths.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+/* The shells when _PATH_SHELLS cannot be read, as on other systems */
+
+static FAR const char * const g_default_shells[] =
+{
+  _PATH_BSHELL, "/bin/csh", NULL
+};
+
+static FAR FILE *g_shells_file;

Review Comment:
   should we move to task tls



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