xiaoxiang781216 commented on PR #16361: URL: https://github.com/apache/nuttx/pull/16361#issuecomment-2891308759
> > > I tried to modify the fcntl/ioctl calls to separate fd and file requests. I don't think it is a good idea to modify/remove FIOC numbers. > > > > > > if so, why not keep implement in nx_ioctl and call nx_ioctl not nx_fcntl in the related places? > > I created nx_fcntl into fs_files for two reasons: > > * Atomically set / get file descriptor flags, like close on exec, fdsan / fdcheck > > * Keep the fl_lock semantics hidden there > > > We could re-name nx_fcntl to nx_modfdflags or something similar ? Would that be acceptable. I think nx_fcntl is now a very confusing name. `fcntl` could not only modify flags in `struct fd`, but also in `struct file`, so ioctl should do both too. So, I can't understand why need move fdsan/fdcheck to `fcntl`, but it's fine if you want to move the implement to fcntl, but please update FIOC_xxx to FL_xxx and stop forwarding them between `ioctl` and `fcntl` for compatibility, since they are introduced to support fdsan/fdcheck which is an internal implementation detail, not expect caller from userspace. -- 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]
