From owner-freebsd-questions@FreeBSD.ORG Fri Aug 7 14:41:13 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A65D1065672 for ; Fri, 7 Aug 2009 14:41:13 +0000 (UTC) (envelope-from psteele@webmail.maxiscale.com) Received: from k2smtpout04-01.prod.mesa1.secureserver.net (k2smtpout04-01.prod.mesa1.secureserver.net [64.202.189.166]) by mx1.freebsd.org (Postfix) with SMTP id 325838FC1D for ; Fri, 7 Aug 2009 14:41:12 +0000 (UTC) Received: (qmail 740 invoked from network); 7 Aug 2009 14:41:12 -0000 Received: from unknown (HELO owa.webmail.maxiscale.com) (72.167.52.135) by k2smtpout04-01.prod.mesa1.secureserver.net (64.202.189.166) with ESMTP; 07 Aug 2009 14:41:12 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Fri, 7 Aug 2009 07:46:48 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How is time zone change signalled? Thread-Index: AcoXbRuwoFKK8KrLTueowaMgccAAdg== From: "Peter Steele" To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How is time zone change signalled? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2009 14:41:13 -0000 We have a suite of applications with a Java GUI controlling everything. One of the actions the user can perform is to set the time zone. We do this through our Java application and update the /etc/localtime as required. We also make an API call to tell the JVM that the time zone as changed, and from the perspective of the Java app, the time zone is changed correctly (the timestamps for example in our log files reflect the change). Likewise, after the user performs this action, running "date" on one of our systems shows that the time zone has been changed as requested.=20 =20 The problem is with our C applications. They continue to operate with the old time zone, so things like timestamps in log files are not in sync with the timestamps in the Java app log files. If we stop and restart the C apps they pick up the time zone change. However, we don't want to take this extreme approach. We want the Java app to signal to the C applications that the time zone has changed. However, I've experimented with the various time zone related calls and I cannot figure out what call is needed to make the C applications pick up the time zone change. I've tried setting the environment variable TZ to the new time zone and this doesn't seem to work, and I've tried calling tzset() and tzsetwall(). In each case after I make these calls the function "localtime()" does not return the same time base as the Java application. =20 I'm obviously missing something the key here. What function call do I need to make to get the C apps to pick up the time zone change? =20