diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
commit | 3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch) | |
tree | f87bd4a126b3a843858eb447e8fd5893c3ee3882 /tests/deckard/contrib/libfaketime/src/faketime_common.h | |
parent | Initial commit. (diff) | |
download | knot-resolver-upstream.tar.xz knot-resolver-upstream.zip |
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/deckard/contrib/libfaketime/src/faketime_common.h')
-rw-r--r-- | tests/deckard/contrib/libfaketime/src/faketime_common.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/deckard/contrib/libfaketime/src/faketime_common.h b/tests/deckard/contrib/libfaketime/src/faketime_common.h new file mode 100644 index 0000000..9fda6a7 --- /dev/null +++ b/tests/deckard/contrib/libfaketime/src/faketime_common.h @@ -0,0 +1,61 @@ +/* + * Faketime's common definitions + * + * Copyright 2013 Balint Reczey <balint@balintreczey.hu> + * + * This file is part of the libfaketime. + * + * libfaketime is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License v2 as published by the Free + * Software Foundation. + * + * libfaketime is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License v2 along + * with libfaketime; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef FAKETIME_COMMON_H +#define FAKETIME_COMMON_H + +#include <stdint.h> + +struct system_time_s +{ + /* System time according to CLOCK_REALTIME */ + struct timespec real; + /* System time according to CLOCK_MONOTONIC */ + struct timespec mon; + /* System time according to CLOCK_MONOTONIC_RAW */ + struct timespec mon_raw; +#ifdef CLOCK_BOOTTIME + /* System time according to CLOCK_BOOTTIME */ + struct timespec boot; +#endif +}; + +/* Data shared among faketime-spawned processes */ +struct ft_shared_s +{ + /* + * When advancing time linearly with each time(), etc. call, the calls are + * counted here */ + uint64_t ticks; + /* Index of timstamp to be loaded from file */ + uint64_t file_idx; + /* System time Faketime started at */ + struct system_time_s start_time; +}; + +/* These are all needed in order to properly build on OSX */ +#ifdef __APPLE__ +#include <mach/clock.h> +#include <mach/mach_host.h> +#include <mach/mach_port.h> +#endif + +#endif |