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 2022/03/29 02:32:29 UTC

[GitHub] [incubator-nuttx] XinStellaris commented on a change in pull request #5894: fs:add _POSIX_OPEN_MAX limit to files_extend

XinStellaris commented on a change in pull request #5894:
URL: https://github.com/apache/incubator-nuttx/pull/5894#discussion_r837000827



##########
File path: fs/inode/fs_files.c
##########
@@ -71,6 +71,11 @@ static int files_extend(FAR struct filelist *list, size_t row)
       return 0;
     }
 
+  if (row * CONFIG_NFILE_DESCRIPTORS_PER_BLOCK > _POSIX_OPEN_MAX)

Review comment:
       In my opinion, _POSIX_OPEN_MAX here is a consistent behavior.
   If you look at sysconf(), you will find that sysconf returns _POSIX_OPEN_MAX, not OPEN_MAX. 
   long sysconf(int name)
   {
   ..................
     switch (name)
       {
   ................
         case _SC_OPEN_MAX:
           return _POSIX_OPEN_MAX;
   
   My point is that this open limit should be the same as what sysconf returns. 
   Considering that OPEN_MAX may be different from _POSIX_OPEN_MAX in the future. If you do want to use OPEN_MAX, I think sysconf should be modified too.
   
   Thanks for your review. It would be great if you can reply again.




-- 
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: commits-unsubscribe@nuttx.apache.org

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