Mercurial > projects > dynamin
comparison dynamin/core/unix_environment.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 73060bc3f004 |
children |
comparison
equal
deleted
inserted
replaced
105:97997a544ac0 | 106:acdbb30fee7e |
---|---|
35 | 35 |
36 template EnvironmentBackend() { | 36 template EnvironmentBackend() { |
37 long backend_timevalToMs(timeval* tv) { | 37 long backend_timevalToMs(timeval* tv) { |
38 return tv.tv_sec*1000L+tv.tv_usec/1000; | 38 return tv.tv_sec*1000L+tv.tv_usec/1000; |
39 } | 39 } |
40 const long timerSec = 31_536_000*5; // 31,536,000 seconds in 365 days | 40 enum long timerSec = 31_536_000*5; // 31,536,000 seconds in 365 days |
41 static this() { | 41 static this() { |
42 itimerval itv; | 42 itimerval itv; |
43 itv.it_value.tv_sec = timerSec; | 43 itv.it_value.tv_sec = timerSec; |
44 if(setitimer(ITIMER_REAL, &itv, null)) | 44 if(setitimer(ITIMER_REAL, &itv, null)) |
45 Stdout("setitimer() failed").newline; | 45 Stdout("setitimer() failed").newline; |