You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/09/14 12:23:08 UTC

[GitHub] [incubator-nuttx] v01d commented on a change in pull request #1756: Add gethrtime() and dummy getrlimit() setrlimit(), add some dependency

v01d commented on a change in pull request #1756:
URL: https://github.com/apache/incubator-nuttx/pull/1756#discussion_r487868723



##########
File path: libs/libc/unistd/lib_getrlimit.c
##########
@@ -0,0 +1,55 @@
+/****************************************************************************
+ * libs/libc/unistd/lib_getrlimit.c
+ *
+ * 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 <string.h>
+#include <errno.h>
+
+#include <sys/resource.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: getrlimit
+ *
+ * Description:
+ *   The getrlimit() and setrlimit() system calls get and
+ *   set resource limits respectively.
+ *
+ ****************************************************************************/
+
+int getrlimit(int resource, FAR struct rlimit *rlp)
+{
+  if (rlp == NULL)
+    {
+      set_errno(EINVAL);
+      return ERROR;
+    }
+
+  memset(rlp, 0, sizeof(*rlp));
+  return OK;

Review comment:
       can you add a comment to indicate this is a stub?

##########
File path: Documentation/conf.py
##########
@@ -37,6 +37,7 @@
 
 # -- Project information -----------------------------------------------------
 
+master_doc = 'index'

Review comment:
       why is this being done here?

##########
File path: libs/libc/unistd/lib_setrlimit.c
##########
@@ -0,0 +1,48 @@
+/****************************************************************************
+ * libs/libc/unistd/lib_setrlimit.c
+ *
+ * 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 <string.h>
+#include <errno.h>
+
+#include <sys/resource.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: setrlimit
+ *
+ * Description:
+ *   The getrlimit() and setrlimit() system calls get and
+ *   set resource limits respectively.
+ *
+ ****************************************************************************/
+
+int setrlimit(int resource, FAR const struct rlimit *rlp)
+{
+  return OK;

Review comment:
       same as the other function




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org