From ebd7426ffd71dbd0e0760424866041b0e28feca4 Mon Sep 17 00:00:00 2001 From: Blake Jones Date: Mon, 5 Nov 2012 07:40:50 +1600 Subject: [PATCH] Re: [PATCH 10/10] timegm: add portable implementation (Solaris support) --- fc/61aaf5bd02c88b34a492be2ba485d4437b1833 | 84 +++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 fc/61aaf5bd02c88b34a492be2ba485d4437b1833 diff --git a/fc/61aaf5bd02c88b34a492be2ba485d4437b1833 b/fc/61aaf5bd02c88b34a492be2ba485d4437b1833 new file mode 100644 index 000000000..3796273c1 --- /dev/null +++ b/fc/61aaf5bd02c88b34a492be2ba485d4437b1833 @@ -0,0 +1,84 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 714EE431FAF + for ; Sun, 4 Nov 2012 07:40:53 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id BJ6begFmNFiN for ; + Sun, 4 Nov 2012 07:40:53 -0800 (PST) +Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D9553431FAE + for ; Sun, 4 Nov 2012 07:40:52 -0800 (PST) +Received: from foo.net (localhost [127.0.0.1]) + by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qA4FeonJ012350; + Sun, 4 Nov 2012 07:40:50 -0800 (PST) +To: Jani Nikula +Subject: Re: [PATCH 10/10] timegm: add portable implementation (Solaris + support) +In-Reply-To: Your message of "Sun, 04 Nov 2012 12:21:01 +0200." + +Date: Sun, 04 Nov 2012 07:40:50 -0800 +Message-ID: <12349.1352043650@foo.net> +From: Blake Jones +X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 + (foo.net [127.0.0.1]); Sun, 04 Nov 2012 07:40:50 -0800 (PST) +X-Mailman-Approved-At: Sun, 04 Nov 2012 13:36:08 -0800 +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 04 Nov 2012 15:40:53 -0000 + +Hi Jani, + +> I'd prefer to use timegm() where available, and the suggested +> alternative [1] elsewhere. +> +> [1] http://www.kernel.org/doc/man-pages/online/pages/man3/timegm.3.html + +I considered this alternative, but decided against it because it's +completely MT-unsafe. I don't know whether libnotmuch itself is +MT-safe, but a process which called this routine in one thread would +temporarily throw off any timezone-related work that any other threads +were doing, even if they weren't using libnotmuch. + +> I'll look into the compat build issues when I have a moment. + +If you do, here's a boiled-down version of the problem that I came up +with while investigating it: + + $ echo 'int main() { extern int foo1(); return foo1(); }' > main.c + $ echo 'int foo1() { extern int bar(); return bar(); }' > foo1.c + $ echo 'int bar() { extern int foo2(); return foo2(); }' > bar.c + $ echo 'int foo2() { return 0; }' > foo2.c + $ gcc -c main.c foo1.c bar.c foo2.c + $ ar rcs libfoo.a foo1.o foo2.o + $ ar rcs libbar.a bar.o + $ gcc -o main main.o libfoo.a libbar.a + [fails] + $ gcc -o main main.o libbar.a libfoo.a + [fails] + +Another alternative would be to just include parse-time-string.o in +libnotmuch.a directly; I think that would solve the problem. + +Blake -- 2.26.2