NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/49207: Add sys/clock.h with generic time macros (derived from clock_subr.h)
The following reply was made to PR kern/49207; it has been noted by GNATS.
From: "Kamil Rytarowski" <n54%gmx.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: martin%duskware.de@localhost
Subject: Re: kern/49207: Add sys/clock.h with generic time macros (derived
from clock_subr.h)
Date: Tue, 16 Sep 2014 21:49:52 +0200
Thank you for your comment.
My diffs are against the current revision of clock_subr.h, build tested wi=
th NetBSD-current (snapshot from 2014-09-10).
Thank you for your note of compat/dev/clock_subr.t, I wasn't aware of that=
file! I'm attaching a patch against it, I'm unsure about inclusion of cloc=
k.h... this way or <sys/clock.h>?
What do you mean with a better separation?
With this patch I want to open doors for unification and MI code reuse.
diff --git a/compat/dev/clock_subr.h b/compat/dev/clock_subr.h
index eb8a7d7..46387a5 100644
--- a/compat/dev/clock_subr.h
+++ b/compat/dev/clock_subr.h
@@ -36,6 +36,8 @@
=C2=A0 * This is a slightly stripped down version of src/sys/dev/clock_sub=
r.h
=C2=A0 */
=C2=A0
+#include "../../../sys/sys/clock.h"
+
=C2=A0/*
=C2=A0 * "POSIX time" to/from "YY/MM/DD/hh/mm/ss"
=C2=A0 */
@@ -52,11 +54,4 @@ struct clock_ymdhms {
=C2=A0time_t=C2=A0=C2=A0 =C2=A0clock_ymdhms_to_secs(struct clock_ymdhms *)=
;
=C2=A0int=C2=A0=C2=A0 =C2=A0clock_secs_to_ymdhms(time_t, struct clock_ymdh=
ms *);
=C2=A0
-/* Some handy constants. */
-#define SECDAY=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0(24 * 60 * 60)
-#define SECYR=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0(SECDAY * 365)
-
-/* Traditional POSIX base year */
-#define=C2=A0=C2=A0 =C2=A0POSIX_BASE_YEAR=C2=A0=C2=A0 =C2=A01970
-
=C2=A0#endif /* _DEV_CLOCK_SUBR_H_ */
Home |
Main Index |
Thread Index |
Old Index