1 /* 2 * Faketime's common definitions 3 * 4 * Copyright 2013 Balint Reczey <balint@balintreczey.hu> 5 * 6 * This file is part of the libfaketime. 7 * 8 * libfaketime is free software; you can redistribute it and/or modify it under 9 * the terms of the GNU General Public License v2 as published by the Free 10 * Software Foundation. 11 * 12 * libfaketime is distributed in the hope that it will be useful, but WITHOUT 13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 15 * more details. 16 * 17 * You should have received a copy of the GNU General Public License v2 along 18 * with libfaketime; if not, write to the Free Software Foundation, Inc., 19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 22 #ifndef FAKETIME_COMMON_H 23 #define FAKETIME_COMMON_H 24 25 #include <stdint.h> 26 27 struct system_time_s 28 { 29 /* System time according to CLOCK_REALTIME */ 30 struct timespec real; 31 /* System time according to CLOCK_MONOTONIC */ 32 struct timespec mon; 33 /* System time according to CLOCK_MONOTONIC_RAW */ 34 struct timespec mon_raw; 35 }; 36 37 /* Data shared among faketime-spawned processes */ 38 struct ft_shared_s 39 { 40 /* 41 * When advancing time linearly with each time(), etc. call, the calls are 42 * counted here */ 43 uint64_t ticks; 44 /* Index of timstamp to be loaded from file */ 45 uint64_t file_idx; 46 /* System time Faketime started at */ 47 struct system_time_s start_time; 48 }; 49 50 #endif 51