tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Using of struct tm in kernel module



But can you explain why that struct is needed inside the kernel? It just
makes no sense at all to me and I am curious :-)

Of course there *are* parts of the kernel that deal with simmilar structures,
like drivers for RTC and they use e.g. struct clock_ymdhms and there are
a few conversion functions for them in src/sys/dev/clock_subr.h, like
clock_sec_to_ymdhms() which takes seconds and converts it to year, month,
day, hour, minute and seconds.
Thanks Martin, this is exactly what I need (clock_subr.h), I don't need all what struct tm provides,
struct clock_ymdhms is sufficient.

Converting from/to struct clock_ymdhms is used for firing fair usage policy event,
which can use weekday or monthday for checking transferred data.
I.e. internet user needs to be notified about transferred data in last week.

Peter



Home | Main Index | Thread Index | Old Index