| 93 | } |
| 94 | |
| 95 | static int timerfd_poll(struct dfs_file *file, struct rt_pollreq *req) |
| 96 | { |
| 97 | struct rt_timerfd *tfd; |
| 98 | int events = 0; |
| 99 | |
| 100 | tfd = file->vnode->data; |
| 101 | |
| 102 | rt_mutex_take(&tfd->lock, RT_WAITING_FOREVER); |
| 103 | |
| 104 | rt_poll_add(&tfd->timerfd_queue, req); |
| 105 | |
| 106 | rt_mutex_release(&tfd->lock); |
| 107 | |
| 108 | if (rt_atomic_load(&(tfd->ticks)) > 0) |
| 109 | { |
| 110 | events |= POLLIN; |
| 111 | } |
| 112 | |
| 113 | return events; |
| 114 | } |
| 115 | |
| 116 | #ifndef RT_USING_DFS_V2 |
| 117 | static ssize_t timerfd_read(struct dfs_file *file, void *buf, size_t count) |
nothing calls this directly
no test coverage detected