| 273 | } |
| 274 | |
| 275 | static int get_current_time(struct rt_timerfd *tfd, struct timespec *time) |
| 276 | { |
| 277 | int ret = 0; |
| 278 | struct timespec *cur_time = RT_NULL; |
| 279 | |
| 280 | if (time == RT_NULL) |
| 281 | { |
| 282 | cur_time = &tfd->pre_time; |
| 283 | } |
| 284 | else |
| 285 | { |
| 286 | cur_time = time; |
| 287 | } |
| 288 | |
| 289 | if (tfd->clockid >= 0) |
| 290 | { |
| 291 | ret = clock_gettime(tfd->clockid, cur_time); |
| 292 | } |
| 293 | else |
| 294 | { |
| 295 | ret = clock_gettime(CLOCK_MONOTONIC, cur_time); |
| 296 | } |
| 297 | |
| 298 | return ret; |
| 299 | } |
| 300 | |
| 301 | static void timerfd_timeout(void *parameter) |
| 302 | { |
no test coverage detected