// D import file generated from 'src\core\sync\config.d'
module core.sync.config;
version (Posix)
{
	private import core.sys.posix.time;

	private import core.sys.posix.sys.time;

	private import core.time;

	void mktspec(ref timespec t);
	void mktspec(ref timespec t, Duration delta)
	{
		mktspec(t);
		mvtspec(t, delta);
	}
	void mvtspec(ref timespec t, Duration delta)
	{
		auto val = delta;
		val += dur!("seconds")(t.tv_sec);
		val += dur!("nsecs")(t.tv_nsec);
		if (val.total!("seconds") > t.tv_sec.max)
		{
			t.tv_sec = t.tv_sec.max;
			t.tv_nsec = cast(typeof(t.tv_nsec))val.fracSec.nsecs;
		}
		else
		{
			t.tv_sec = cast(typeof(t.tv_sec))val.total!("seconds");
			t.tv_nsec = cast(typeof(t.tv_nsec))val.fracSec.nsecs;
		}
	}
}
