The second parameter of timerfd_settime ()?

I want to ask all of you. I want to use the timer under Linux timerfd

.

examples are as follows:

    struct itimerspec new_value;
    struct timespec now;

    int ret = clock_gettime(CLOCK_REALTIME, &now);//
    assert(ret != -1);


    new_value.it_value.tv_sec = now.tv_sec + 1; //
    new_value.it_value.tv_nsec = now.tv_nsec; 

    new_value.it_interval.tv_sec = 1;      //
    new_value.it_interval.tv_nsec = 0;

    int timefd = timerfd_create(CLOCK_REALTIME, TFD_NONBLOCK); // 
    assert(timefd != -1);

    // ret = timerfd_settime(timefd, `0, &new_value, NULL);//
    ret = timerfd_settime(timefd, TFD_TIMER_ABSTIME, &new_value, NULL);//

as in the example above, I want to create a relative timer with the parameter CLOCK_REALTIME , which is used in both the clock_gettime and timerfd_create functions, and then should not be the corresponding relative timer in the timerfd_settime function when the second parameter is 0 , but the timer is not triggered when epoll is set to 0 . Instead, the timer works properly when the timerfd_settime second parameter is set to TFD_TIMER_ABSTIME (shouldn"t this parameter correspond to absolute time)

Mar.31,2022

timerfd man page

By default, the initial expiration time specified in new_value is interpreted relative to the current time on the timer's clock at the time of the call (i.e., new_value.it_value specifies a time relative to the current value of the clock specified by clockid).

new_value.it_value set the time of the initial timing

if timerfd_settime the second parameter is set to 0 , new_value.it_value is set to 1
if timerfd_settime the second parameter is set to TFD_TIMER_ABSTIME , new_value.it_value is set to now.tv_sec + 1

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4dc81-444a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4dc81-444a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?