timespec_get.c revision fc2512cfb727d49529d8ed99164db871f4829b73
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * This file and its contents are supplied under the terms of the
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * Common Development and Distribution License ("CDDL"), version 1.0.
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * You may only use this file in accordance with the terms of version
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * 1.0 of the CDDL.
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * A full copy of the text of the CDDL should have accompanied this
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * source. A copy of the CDDL is also available via the Internet at
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * Copyright 2016 Joyent, Inc.
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi * Basic tests for timespec_get(3C).
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchitimespec_cmp(const struct timespec *ls, const struct timespec *rs)
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi VERIFY0(clock_gettime(CLOCK_REALTIME, &pre));
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi VERIFY3S(timespec_get(&ts, TIME_UTC), ==, TIME_UTC);
fc2512cfb727d49529d8ed99164db871f4829b73Robert Mustacchi VERIFY0(clock_gettime(CLOCK_REALTIME, &post));