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



On Mon, Mar 03, 2025 at 08:36:53AM +0100, Peter Skvarka wrote:
> When I look into include/time.h it seems that struct tm and functions
> working with it
> are only for user-mode code. I dont know if exist some library for kernel
> providing some similar functions,
> or  if can simple ported to be functional in kernel module.

struct tm is about calendars, timezones (and used together with locales).
None of that exist in the kerenl, so why would "struct tm" be a good 
representation for anything the kernel deals with?

The typical kernel interface used for such things is struct timespec,
see timeval(3).

Martin


Home | Main Index | Thread Index | Old Index