pussuw commented on code in PR #16499: URL: https://github.com/apache/nuttx/pull/16499#discussion_r2135751772
########## fs/vfs/fs_ioctl.c: ########## @@ -194,6 +154,65 @@ static int file_vioctl(FAR struct file *filep, int req, va_list ap) return ret; } +/**************************************************************************** + * Name: nx_vioctl + ****************************************************************************/ + +static int nx_vioctl(int fd, int req, va_list ap) +{ + FAR struct file *filep; + FAR struct fd *fdp; + int ret; + + ret = file_get2(fd, &filep, &fdp); + if (ret < 0) + { + return ret; + } + + switch (req) + { + case FIOCLEX: + fdp->f_cloexec = true; + break; + + case FIONCLEX: + fdp->f_cloexec = false; + break; + + case FIOGCLEX: + *va_arg(ap, FAR int *) = fdp->f_cloexec; Review Comment: This should return FD_CLOEXEC or 0. -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org