Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
//config: MMDDhhmm[[YY]YY][.ss] format.
#include "libbb.h"
//config: MMDDhhmm[[YY]YY][.ss] format.
#include "libbb.h"
+#if ENABLE_FEATURE_DATE_NANO
+# include <sys/syscall.h>
+#endif
enum {
OPT_RFC2822 = (1 << 0), /* R */
enum {
OPT_RFC2822 = (1 << 0), /* R */
#endif
} else {
#if ENABLE_FEATURE_DATE_NANO
#endif
} else {
#if ENABLE_FEATURE_DATE_NANO
- clock_gettime(CLOCK_REALTIME, &ts);
+ /* libc has incredibly messy way of doing this,
+ * typically requiring -lrt. We just skip all this mess */
+ syscall(__NR_clock_gettime, CLOCK_REALTIME, &ts);
#else
time(&ts.tv_sec);
#endif
#else
time(&ts.tv_sec);
#endif