mirror of
https://git.freebsd.org/ports.git
synced 2025-05-23 04:03:14 -04:00
libfaketime intercepts various system calls which programs use to retrieve the current date and time. It can then report faked dates and times (as specified by you, the user) to these programs. This means you can modify the system time a program sees without having to change the time system-wide. libfaketime allows you to specify both absolute dates (e.g., 01/01/2004) and relative dates (e.g., 10 days ago). libfaketime might be used for various purposes, for example - Running legacy software with y2k bugs - Testing software for year-2038 compliance - Debugging time-related issues, such as expired SSL certificates - Running software which ceases to run outside a certain timeframe - Using different system-wide date and time settings, e.g., on OpenVZ- based virtual machines running on the same host - Deterministic build processes. WWW: https://github.com/wolfcw/libfaketime
29 lines
688 B
C
29 lines
688 B
C
--- src/libfaketime.c.orig 2016-06-27 06:54:00 UTC
|
|
+++ src/libfaketime.c
|
|
@@ -23,6 +23,17 @@
|
|
|
|
#define _GNU_SOURCE /* required to get RTLD_NEXT defined */
|
|
|
|
+/*
|
|
+ * libfaketime.c:1246:5: error: conflicting types for 'gettimeofday'
|
|
+ * int gettimeofday(struct timeval *tv, void *tz)
|
|
+ * vs
|
|
+ * int gettimeofday(struct timeval *, struct timezone *);
|
|
+ */
|
|
+
|
|
+#define gettimeofday bsd_gettimeofday
|
|
+#include <sys/time.h>
|
|
+#undef gettimeofday
|
|
+
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
@@ -58,6 +69,8 @@
|
|
extern char *__progname;
|
|
#ifdef __sun
|
|
#include "sunos_endian.h"
|
|
+#elif defined(__FreeBSD__)
|
|
+#include <sys/endian.h>
|
|
#else
|
|
#include <endian.h>
|
|
#endif
|