<div dir="ltr"><div><div><div><div><br></div>I see tons of unknown clock_gettime() error: -1 imessage in the log.<br><br></div>I think, it is related to the following check (i'm not a c guru) in /programs/pluto/defs.c<br><br>monotime_t mononow(void)<br>{<br>        monotime_t m;<br><br>#ifdef _POSIX_MONOTONIC_CLOCK<br>        struct timespec t;<br>        int r = clock_gettime(<br>#   ifdef CLOCK_BOOTTIME<br>                CLOCK_BOOTTIME  /* best */<br>#   else<br>                CLOCK_MONOTONIC /* second best */<br>#   endif<br>                , &t);<br><br>        switch (r) {<br>        case 0:<br>                /* OK */<br>                m.mono_secs =  t.tv_sec;<br>                return m;<br>        case EINVAL:<br>                libreswan_log("Invalid clock method for clock_gettime() - possibly compiled with mismatched kernel and glibc-headers ");<br>                break;<br>        case EPERM:<br>                libreswan_log("No permission for clock_gettime()");<br>                break;<br>        case EFAULT:<br>                libreswan_log("Invalid address space return by clock_gettime()");<br>                break;<br>        default:<br>                libreswan_log("unknown clock_gettime() error: %d", r);<br>                break;<br>        }<br>#   endif<br>        return mononow_fallback();<br>}<br><br></div>Strace below:<br><br>pid 11467] clock_gettime(CLOCK_MONOTONIC, {1297, 310762308}) = 0<br>[pid 11467] gettimeofday({1487233895, 599484}, NULL) = 0<br>[pid 11467] epoll_wait(7, {}, 32, 31)   = 0<br>[pid 11467] clock_gettime(CLOCK_MONOTONIC, {1297, 350370525}) = 0<br>[pid 11467] gettimeofday({1487233895, 639071}, NULL) = 0<br>???---->>>[pid 11467] clock_gettime(0x7 /* CLOCK_??? */, 0x7fff6917e6c0) = -1 EINVAL (Invalid argument)<br>[pid 11467] gettimeofday({1487233895, 639209}, NULL) = 0<br>[pid 11467] write(3, "Feb 16 09:31:35: unknown clock_g"..., 51) = 51<br>[pid 11467] gettimeofday({1487233895, 639338}, NULL) = 0<br>[pid 11467] clock_gettime(0x7 /* CLOCK_??? */, 0x7fff6917e650) = -1 EINVAL (Invalid argument)<br>[pid 11467] gettimeofday({1487233895, 639418}, NULL) = 0<br>[pid 11467] write(3, "Feb 16 09:31:35: unknown clock_g"..., 51) = 51<br>[pid 11467] gettimeofday({1487233895, 639504}, NULL) = 0<br><br><br></div>When i replace the entire check, with a fixed CLOCK_MONOTONIC (i have a 2.6.32.70 kernel so CLOCK_BOOTIME not exist) i dont see more "-1" messages in the log or strace.<br><br>monotime_t mononow(void)<br>{<br>        monotime_t m;<br><br>        struct timespec t;<br>        int r = clock_gettime(CLOCK_MONOTONIC, &t);<br><br>        switch (r) {<br>        case 0:<br>                /* OK */<br>                m.mono_secs =  t.tv_sec;<br>                return m;<br>        case EINVAL:<br>                libreswan_log("Invalid clock method for clock_gettime() - possibly compiled with mismatched kernel and glibc-headers ");<br>                break;<br>        case EPERM:<br>                libreswan_log("No permission for clock_gettime()");<br>                break;<br>        case EFAULT:<br>                libreswan_log("Invalid address space return by clock_gettime()");<br>                break;<br>        default:<br>                libreswan_log("unknown clock_gettime() error: %d", r);<br>                break;<br>        }<br>        return mononow_fallback();<br>}<br><br><div>Thx<br></div><div>Godot<br></div><div><br><br><div><div><br><br></div></div></div></div>