xiaoxiang781216 commented on a change in pull request #5014:
URL: https://github.com/apache/incubator-nuttx/pull/5014#discussion_r771824136



##########
File path: include/sys/syscall_lookup.h
##########
@@ -218,6 +218,11 @@ SYSCALL_LOOKUP(pwrite,                     4)
 #ifdef CONFIG_EVENT_FD
   SYSCALL_LOOKUP(eventfd,                  2)
 #endif
+#ifdef CONFIG_TIMER_FD
+  SYSCALL_LOOKUP(timerfd_create,           2)
+  SYSCALL_LOOKUP(timerfd_settime,          4)
+  SYSCALL_LOOKUP(timerfd_gettime,          2)

Review comment:
       The idea is simple:
   
   1. Add ioctl(e.g. TIMERFD_SETTIME, TIMER_GETTIME)
   2. Move the code from timerfd_settime/timerfd_getime) to timerfd_ioctl
   3. Implement timerfd_settime and timerfd_gettime in libc as the simple ioctl 
wrapper.
   
   Many driver use this technique, you can reference terminal API here:
   https://github.com/apache/incubator-nuttx/tree/master/libs/libc/termios
   
https://github.com/apache/incubator-nuttx/blob/master/drivers/serial/serial.c#L1335-L1445




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


Reply via email to