Return-Path: X-Original-To: apmail-apr-dev-archive@www.apache.org Delivered-To: apmail-apr-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4ED3418795 for ; Wed, 28 Oct 2015 19:52:58 +0000 (UTC) Received: (qmail 49234 invoked by uid 500); 28 Oct 2015 19:52:53 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 49149 invoked by uid 500); 28 Oct 2015 19:52:53 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 49139 invoked by uid 99); 28 Oct 2015 19:52:53 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Oct 2015 19:52:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 73A53C0F5F for ; Wed, 28 Oct 2015 19:52:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 tagged_above=-999 required=6.31 tests=[URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id pY2B7fsPmMGC for ; Wed, 28 Oct 2015 19:52:42 +0000 (UTC) Received: from turms.7val.com (turms.7val.com [213.196.234.34]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id DE82020927 for ; Wed, 28 Oct 2015 19:52:41 +0000 (UTC) Received: from localhost (amavis.7val.com [172.22.0.32]) by localhost (Postfix) with ESMTP id 8CABF39538A6 for ; Wed, 28 Oct 2015 20:52:35 +0100 (CET) Received: from turms.7val.com ([172.22.0.34]) by localhost (amavis.7val.com [172.22.0.32]) (amavisd-new, port 10024) with ESMTP id G3Qt4EpuGRsW for ; Wed, 28 Oct 2015 20:52:32 +0100 (CET) Received: from qube.nonet (xdsl-87-78-103-247.netcologne.de [87.78.103.247]) by turms.7val.com (Postfix) with ESMTP for ; Wed, 28 Oct 2015 20:52:32 +0100 (CET) Received: from tezro.nonet (tezro.nonet [10.0.0.1]) by qube.nonet (Postfix) with ESMTP id 26DBA39224 for ; Wed, 28 Oct 2015 20:52:30 +0100 (CET) Received: from tezro.nonet (localhost [127.0.0.1]) by tezro.nonet (SGI-8.12.11.20060308/8.12.11) with ESMTP id t9SJqCUP002948 for ; Wed, 28 Oct 2015 20:52:12 +0100 (CET) Received: (from canavan@localhost) by tezro.nonet (SGI-8.12.11.20060308/8.12.11/Submit) id t9SJqBe3002946 for dev@apr.apache.org; Wed, 28 Oct 2015 20:52:11 +0100 (CET) Resent-From: "Rainer M. Canavan" Resent-Message-Id: <201510281952.t9SJqBe3002946@tezro.nonet> Message-Id: <201510281952.t9SJqBe3002946@tezro.nonet> Resent-Date: Wed, 28 Oct 2015 20:52:11 +0100 (CET) Resent-To: dev@apr.apache.org Date: Sun, 25 Oct 2015 22:57:09 +0100 (CET) To: trawick@gmail.com Subject: Re[4]: IRIX errno for apr_stroff, apr_atoi64 From: "Rainer M. Canavan" In-Reply-To: X-Mailer: Ishmail 2.1.0-20150803-mips-sgi-irix6.5 MIME-Version: 1.0 Content-Type: text/plain Jeff Trawick wrote: > On Fri, Oct 16, 2015 at 7:45 PM, Rainer M. Canavan wrote: > > > William A Rowe Jr wrote: > > > Any chance you could review the man page of these functions on IRIX and > > > report back, specifically return value and error exceptions? MAX is a > > > valid value. They might be playing some game with endptr to signify > > errors. > > > > There's no hint to such a behaviour in the manpage (available > > online e.g. at > > http://irix.polarhome.com/service/man/?qf=strtoull&tf=2&of=IRIX&sf=3 ), > > and my experiments would indicate that the endptr just doesn't care > > about numeric overflows and happily points at the character following > > 100 or more '9's. > > > > It turns out that it is indeed pthread's fault, and errno behaves > > properly if one either #include as well whenever > > is used, or alternatively, errno.h can be persuaded to use the thread-safe > > definition of errno by defining _SGI_MP_SOURCE, _POSIX_C_SOURCE >= 199506L > > or _XOPEN_SOURCE >= 500. I haven't tested any of those with apr yet, > > just with a small test program. > > > > rainer > > > > That's essentially like _REENTRANT on Solaris; I helped someone with their > hopeless socket API code years ago and saw that they had inserted checks > for all sorts of errno values they had seen in testing but it was never > enough. (They weren't accessing the errno value for the thread.) > > Look in build/apr_hints.m4 for the proper place for such settings, including > > *-irix*) > APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) _SGI_MP_SOURCE=1 seems to work: - APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS]) + APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS -D_SGI_MP_SOURCE=1]) The other two defines I listed above aren't useful for building apr. -D_POSIX_C_SOURCE=199506 causes a build failure because getpass() is undefined, and "A value of type "int" cannot be used to initialize an entity of type "char *" in apr_getpass.c Line 242. If I cause "function is declared implicitly" to cause compile errors, configure aborts while trying to determine the format for apr_ssize_t (because exit() is defined implicitly in those tests). Similarly, defining _XOPEN_SOURCE makes hstrerror() disappear. I would have expected autoreconf to be sufficient to pick up changes to apr_hints.m4, or ideally just running make to cause a complete re-build of all the auto* stuff, but I had to unpack the source, edit apr_hints.m4, run autoreconf, configure and build to get the desired changes to propagate. rainer