-
Hi, GTimeVal in glib-2.0 is being deprecated (still supported for some time but not recommended) since 2.62 because it is not year-2038-safe. It is recommended to use GDateTime to replace GTimeVal. I find there are some use of GTimeVal in syslog-ng. So I would like to know whether there is plan for the replacement or other solution for the future glib-2.0 without GTimeVal. Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
We have our own UnixTime structure, which is used almost exclusively where a message timestamp is concerned:
This is y2038 safe as we are using a 64 bit timestamp here, but this adds a timezone offset which might not be needed in all cases where we are currently using GTimeVal. GDateTime is probably not the right fit, by a simple look at its implementation it seems to be pretty heavyweight, especially for our use-cases. In places where the timezone information makes sense, I'd use our UnixTime structure, in other cases where it doesn't, I'd just use "struct timespec" or a 64bit time_t value. Why do you ask? Could you help us to get rid of all those GTimeVals? It would be appreciated. |
Beta Was this translation helpful? Give feedback.
We have our own UnixTime structure, which is used almost exclusively where a message timestamp is concerned:
This is y2038 safe as we are using a 64 bit timestamp here, but this adds a timezone offset which might not be needed in all cases where we are currently using GTimeVal.
GDateTime is probably not the right fit, by a simple look at i…