On Mon, May 21, 2012 at 11:01:03AM -0700, John Stultz wrote:Hrm. I prefer to keep things fairly flat (even having time.h and timex.h bugs me somewhat). But having such a separation could be useful, but maybe at a slightly more coarse level. Something like timekeeping-internal.h and time.h, splitting all the general accessors away from the non-general.On 05/18/2012 07:09 AM, Richard Cochran wrote:This is a private interface only for ntp.c, not for the whole rest of+Why not just add these to time.h?
+int timekeeping_gettod_status(struct timespec *ts, time_t *offset);
+
+void timekeeping_delete_leap_second(void);
+
+void timekeeping_finish_leap_second(void);
+
+void timekeeping_insert_leap_second(void);
+
+#endif
the kernel via time.h.
BTW this highlights the very icky incestuous relationship betweenThe locking order is pretty straight forward: timekeeper.lock -> ntp_lock. This only gets messy when you require timekeeping data from the ntp context, but usually we provide the required data via the caller. But better documentation is always welcome.
ntp.c and timekeeper.c. Probably there should be a comment documenting
the (unspoken) locking sequence for ntp_lock and timekeeper.lock.