When can the call to mktime in C program can return -1, assuming the value passed to it are valid only.
In documentation it is mentioned as If the calendar time cannot be represented as valid, a value of -1 is returned.
Is it possible if anyone can share code behind for this mktime function call to understand what can fail it?
P.S The environment is linux on m68k processor
struct tmused.mktimebecause it neither normalizes thestruct tmit is passed and sets thetm_wdayandtm_ydaycomponents nor determines whether an error as occurred. I suspect it is a routine with the same name with a subset of the function intended solely for limited use inside the kernel.