#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <sys/time.h>

int main() {
	time_t time1;
	struct tm tm;
	char timestr[100];
	struct timeval tv;

	time(&time1);
	localtime_r(&time1, &tm);
	strftime(timestr, sizeof timestr, "%Y/%m/%d %H:%M:%S", &tm);
	printf("%s\n", timestr);

	gettimeofday(&tv, NULL);

	if (chroot("/home/matt/test/jail") < 0) {
		perror("chroot");
		return 1;
	}
	sleep(2);

	gettimeofday(&tv, NULL);

	time(&time1);
	localtime_r(&time1, &tm);
	strftime(timestr, sizeof timestr, "%Y/%m/%d %H:%M:%S", &tm);
	printf("%s\n", timestr);

	return 0;
}
