casaroli commented on code in PR #20784:
URL: https://github.com/apache/nuttx/pull/20784#discussion_r4308544585


##########
sched/group/group_rlimit.c:
##########
@@ -0,0 +1,221 @@
+/****************************************************************************
+ * sched/group/group_rlimit.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 <sys/resource.h>
+#include <errno.h>
+#include <limits.h>
+#include <sched.h>
+#include <stdint.h>
+
+#include <nuttx/sched.h>
+
+#include "group/group.h"
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: group_rlimit
+ *
+ * Description:
+ *   Return the limit of a task group for a resource that NuttX enforces,
+ *   or NULL for any other resource.
+ *
+ ****************************************************************************/
+
+static FAR struct rlimit *group_rlimit(FAR struct task_group_s *group,

Review Comment:
   Done.



##########
libs/libc/misc/lib_getstacksize.c:
##########
@@ -0,0 +1,77 @@
+/****************************************************************************
+ * libs/libc/misc/lib_getstacksize.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 <sys/resource.h>
+#include <pthread.h>
+
+#include <nuttx/lib/lib.h>
+#include <nuttx/tls.h>

Review Comment:
   For TLS_MAXSTACK: with CONFIG_TLS_ALIGNED a stack cannot be larger than 
that, so the limit is kept below it.



##########
sched/pthread/pthread_create.c:
##########
@@ -207,6 +208,10 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR 
pthread_t *thread,
           default_attr.priority = parent->sched_priority;
         }
 
+      /* The RLIMIT_STACK soft limit gives the default stack size */
+
+      default_attr.stacksize =
+        lib_get_stacksize(default_attr.stacksize);

Review Comment:
   Done.



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