From owner-freebsd-hackers@FreeBSD.ORG Fri Aug 7 21:06:03 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 159991065677 for ; Fri, 7 Aug 2009 21:06:03 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outM.internet-mail-service.net (outm.internet-mail-service.net [216.240.47.236]) by mx1.freebsd.org (Postfix) with ESMTP id F261D8FC19 for ; Fri, 7 Aug 2009 21:06:02 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 820D2D1FDD; Fri, 7 Aug 2009 14:06:02 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 9AD0C2D6004; Fri, 7 Aug 2009 14:06:01 -0700 (PDT) Message-ID: <4A7C9738.10103@elischer.org> Date: Fri, 07 Aug 2009 14:06:00 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605) MIME-Version: 1.0 To: Peter Steele References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: How to signal a time zone change? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2009 21:06:03 -0000 Peter Steele wrote: > 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. > > > > 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 You need to signal your app in some way.. Assuming you have source for the app then you can monitor /etc/localtime (or /etc) for change with kevent. > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"