Skip to content

Is there any plan for syslog-ng to use GDateTime to replace GTimeVal? #4292

Answered by bazsi
ylse asked this question in Q&A
Discussion options

You must be logged in to vote

We have our own UnixTime structure, which is used almost exclusively where a message timestamp is concerned:

typedef struct _UnixTime UnixTime;
struct _UnixTime
{
  gint64 ut_sec;
  guint32 ut_usec;

  /* zone offset in seconds, add this to UTC to get the time in local.  This
   * is just 32 bits, contrary to all other gmtoff variables, as we are
   * squeezed in space with this struct.  32 bit is more than enough for
   * +/-24*3600 */
  gint32 ut_gmtoff;
};

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…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ylse
Comment options

Answer selected by MrAnno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants