October 22, 2024
Chicago 12, Melborne City, USA
C#

Why does my timezone not update in embedded linux?


I have an embedded Linux with a write lock on all system folders (including /etc) and only one folder being freely writable, called /writable. /etc/localtime is a symbolic link that points to /writable/localtime.

My (test) application changes the timezone by copying a different timezone file into the location at /writable/localtime, then calls tzset() and tries to read tzname.

However regardless of whether I copy the timezone information or turn the file into a symlink pointing elsewhere, tzset does neither change tzname, nor does it update the offsets (meaning using localtime yields the same results).

Only after restarting the application, the new timezone takes effect.

Why?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video