1 Return-Path: <blakej@foo.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 4F1ED431FBC
\r
6 for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:10:12 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id NhTsbD1LKcMs for <notmuch@notmuchmail.org>;
\r
16 Tue, 13 Nov 2012 18:10:11 -0800 (PST)
\r
17 Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 07B74431FBD
\r
21 for <notmuch@notmuchmail.org>; Tue, 13 Nov 2012 18:10:10 -0800 (PST)
\r
22 Received: from foo.net (localhost [127.0.0.1])
\r
23 by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qAE2A9tU018889;
\r
24 Tue, 13 Nov 2012 18:10:09 -0800 (PST)
\r
25 Received: (from blakej@localhost)
\r
26 by foo.net (8.14.5+Sun/8.14.5/Submit) id qAE2A9Np018888;
\r
27 Tue, 13 Nov 2012 18:10:09 -0800 (PST)
\r
28 From: Blake Jones <blakej@foo.net>
\r
29 To: notmuch@notmuchmail.org
\r
30 Subject: [PATCH v3 01/10] getpwuid: check for standards compliance (Solaris
\r
32 Date: Tue, 13 Nov 2012 18:09:56 -0800
\r
33 Message-Id: <1352859005-18631-2-git-send-email-blakej@foo.net>
\r
34 X-Mailer: git-send-email 1.7.3.2
\r
35 In-Reply-To: <1352859005-18631-1-git-send-email-blakej@foo.net>
\r
36 References: <1352859005-18631-1-git-send-email-blakej@foo.net>
\r
37 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2
\r
38 (foo.net [127.0.0.1]); Tue, 13 Nov 2012 18:10:09 -0800 (PST)
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.13
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Wed, 14 Nov 2012 02:10:12 -0000
\r
53 Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs
\r
54 to be defined to get the right number of arguments in the prototypes for
\r
55 getpwuid_r(). Solaris' default implementation conforms to POSIX.1c
\r
56 Draft 6, rather than the final POSIX.1c spec. The standards-compliant
\r
57 version can be used by defining _POSIX_PTHREAD_SEMANTICS.
\r
59 This change also adds the file "compat/check_getpwuid.c", which
\r
60 configure uses to perform its check, and modifies compat/compat.h to
\r
61 define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.
\r
63 compat/check_getpwuid.c | 11 +++++++++++
\r
64 compat/compat.h | 4 ++++
\r
65 configure | 23 +++++++++++++++++++++--
\r
66 3 files changed, 36 insertions(+), 2 deletions(-)
\r
67 create mode 100644 compat/check_getpwuid.c
\r
69 diff --git a/compat/check_getpwuid.c b/compat/check_getpwuid.c
\r
70 new file mode 100644
\r
71 index 0000000..c435eb8
\r
73 +++ b/compat/check_getpwuid.c
\r
80 + struct passwd passwd, *ignored;
\r
82 + (void) getpwuid_r (0, &passwd, NULL, 0, &ignored);
\r
86 diff --git a/compat/compat.h b/compat/compat.h
\r
87 index b2e2736..efea023 100644
\r
88 --- a/compat/compat.h
\r
89 +++ b/compat/compat.h
\r
90 @@ -54,6 +54,10 @@ char* strcasestr(const char *haystack, const char *needle);
\r
91 #define IGNORE_RESULT(x) x
\r
92 #endif /* __GNUC__ */
\r
95 +#define _POSIX_PTHREAD_SEMANTICS 1
\r
101 diff --git a/configure b/configure
\r
102 index ea8a1ad..bb5031e 100755
\r
105 @@ -512,6 +512,17 @@ else
\r
107 rm -f compat/have_strcasestr
\r
109 +printf "Checking for standard version of getpwuid_r... "
\r
110 +if ${CC} -o compat/check_getpwuid "$srcdir"/compat/check_getpwuid.c > /dev/null 2>&1
\r
115 + printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"
\r
118 +rm -f compat/check_getpwuid
\r
120 printf "int main(void){return 0;}\n" > minimal.c
\r
122 printf "Checking for rpath support... "
\r
123 @@ -671,6 +682,11 @@ HAVE_GETLINE = ${have_getline}
\r
124 # build its own version)
\r
125 HAVE_STRCASESTR = ${have_strcasestr}
\r
127 +# Whether the getpwuid_r function is standards-compliant
\r
128 +# (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS
\r
129 +# to enable the standards-compliant version -- needed for Solaris)
\r
130 +STD_GETPWUID = ${std_getpwuid}
\r
132 # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD
\r
133 PLATFORM = ${platform}
\r
135 @@ -715,10 +731,13 @@ WITH_ZSH = ${WITH_ZSH}
\r
136 # Combined flags for compiling and linking against all of the above
\r
137 CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
138 \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
\r
139 - \$(VALGRIND_CFLAGS) -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)
\r
140 + \$(VALGRIND_CFLAGS) \\
\r
141 + -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
\r
142 + -DSTD_GETPWUID=\$(STD_GETPWUID)
\r
143 CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\r
144 \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
\r
145 \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS) \\
\r
146 - -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)
\r
147 + -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR) \\
\r
148 + -DSTD_GETPWUID=\$(STD_GETPWUID)
\r
149 CONFIGURE_LDFLAGS = \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)
\r