@@ -452,6 +452,20 @@ public:
452
452
ts.tv_nsec / 100 +
453
453
hnsecsToUnixEpoch;
454
454
}
455
+ else version(NetBSD)
456
+ {
457
+ static if(clockType == ClockType.second)
458
+ return unixTimeToStdTime(core.stdc.time.time(null));
459
+ else
460
+ {
461
+ timeval tv;
462
+ if(gettimeofday(&tv, null) != 0)
463
+ throw new TimeException("Call to gettimeofday() failed");
464
+ return convert!("seconds", "hnsecs")(tv.tv_sec) +
465
+ convert!("usecs", "hnsecs")(tv.tv_usec) +
466
+ hnsecsToUnixEpoch;
467
+ }
468
+ }
455
469
else version(Solaris)
456
470
{
457
471
static if(clockType == ClockType.second)
@@ -27049,6 +27063,7 @@ public:
27049
27063
version(Posix)
27050
27064
{
27051
27065
version(FreeBSD) enum utcZone = "Etc/UTC";
27066
+ else version(NetBSD) enum utcZone = "UTC";
27052
27067
else version(linux) enum utcZone = "UTC";
27053
27068
else version(OSX) enum utcZone = "UTC";
27054
27069
else static assert(0, "The location of the UTC timezone file on this Posix platform must be set.");
@@ -27488,6 +27503,10 @@ public:
27488
27503
// A bug on FreeBSD 9+ makes it so that this test fails.
27489
27504
// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=168862
27490
27505
}
27506
+ else version(NetBSD)
27507
+ {
27508
+ // The same bug on NetBSD 7+
27509
+ }
27491
27510
else
27492
27511
{
27493
27512
setTZEnvVar("America/Los_Angeles");
@@ -28929,6 +28948,7 @@ public:
28929
28948
28930
28949
if(!tzName.extension().empty ||
28931
28950
!tzName.startsWith(subName) ||
28951
+ tzName == "leapseconds" ||
28932
28952
tzName == "+VERSION")
28933
28953
{
28934
28954
continue;
0 commit comments