Re: [PATCH 10/10] timegm: add portable implementation (Solaris support)
authorBlake Jones <blakej@foo.net>
Sun, 4 Nov 2012 15:40:50 +0000 (07:40 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:18 +0000 (09:50 -0800)
fc/61aaf5bd02c88b34a492be2ba485d4437b1833 [new file with mode: 0644]

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