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/07/31 12:58:02 UTC

[GitHub] [incubator-nuttx] spiriou edited a comment on pull request #1479: fs/vfs: Add file descriptor based events support

spiriou edited a comment on pull request #1479:
URL: https://github.com/apache/incubator-nuttx/pull/1479#issuecomment-667091997


   @xiaoxiang781216 Regarding your comment:
   Why we limit the user select the I/O mode? Here is Linux implementation:
   https://github.com/torvalds/linux/blob/b29482fde649c72441d5478a4ea2c52c56d97a5e/fs/eventfd.c#L231
   You can see it also check file->f_flags.
   
   In Linux eventfd is opened only once, and forwarded to other threads with fork or other methods. Hence f_flags is ok to define current eventfd mode.
   In nuttx other process have to open /var/event/efdXXX. Hence one process can open with EFD_SEMAPHORE and the other without, leading to inconsistency.
   To solve this issue, the eventfd mode is the one specified in the first open, ie. by the caller of "eventfd()" syscall. The following open() calls don't have to specify again the mode in there f_flags as it is already defined by the f_flags from the process that called "eventfd()".
   
   We can simplify this contribution by considering that an eventfd can only be opened once, ie. only for multi threading inside a single process. This would remove the need for "eventfd_get_minor()" and the FIOC_MINOR ioctl.
   
   What do you think ?
   


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