From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 880C83858D3C for ; Wed, 16 Feb 2022 08:55:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 880C83858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645001746; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IfPWP4ZhwHLVJgYZ6TNwtmYueoBP/08P0BK41GIJIOQ=; b=O9qRYbeHASB+X81XjX7ptuUd0oQ9WoFb8Ux9DkETt8THEa1L+CBzBCFgZyJ8g9Fhzjia+q SlHyRaWtZvbnoJvTM8XdPt7Gf8o29SJbNVzNatD4G+wv1ZfYlntz4aS1N03lZF/7r6rivE 4Bhsf0FSz977GJPqoOKzmSdUIm9A7eg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-Wd2GiQB3OSuw9fpy3xQQLw-1; Wed, 16 Feb 2022 03:55:40 -0500 X-MC-Unique: Wd2GiQB3OSuw9fpy3xQQLw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EFF4801B1C for ; Wed, 16 Feb 2022 08:55:40 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1D65E730 for ; Wed, 16 Feb 2022 08:55:39 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 559C7A807A1; Wed, 16 Feb 2022 09:55:38 +0100 (CET) Date: Wed, 16 Feb 2022 09:55:38 +0100 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 0/1] newlib/libc/time/tzset_r.c(_tzset_unlocked_r): add POSIX <> quoted abbrs Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220215215701.40283-1-Brian.Inglis@SystematicSW.ab.ca> <1451bc59-821e-aa0f-100a-8abceca94662@SystematicSw.ab.ca> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2022 08:55:48 -0000 On Feb 15 22:38, Brian Inglis wrote: > On 2022-02-15 15:04, Brian Inglis wrote: > > Submitted a newlib patch which builds okay, but cannot test, as I don't > > have a newlib platform to run on, and Cygwin uses it's own TZ DB code > > base. > > It should accept up to 10 character abbreviations for STD and DST > > matching POSIX specs including anything within < > quoted content. > > If someone needing this could build, test, and send feedback, I'd > > appreciate it. > > --- > >   newlib/libc/time/tzset_r.c | 68 ++++++++++++++++++++++++++++++++------ > >   1 file changed, 58 insertions(+), 10 deletions(-) > > Regarding the 10 character limit above, reviewing the POSIX and tzset.c > documentation, the size limit should be TZNAME_MAX, so some changes may need > to be made to the values or the code, as _POSIX_TZNAME_MAX is the minimum > acceptable value: > > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html > > and the value used should be that configured: > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html > > also: > > https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap08.html#tag_21_08_03_05 > > newlib/libc/include/sys/unistd.h:#define _SC_TZNAME_MAX 20 > newlib/libc/sys/rtems/include/limits.h:#define _POSIX_TZNAME_MAX 3 > newlib/libc/sys/rtems/include/limits.h:#define TZNAME_MAX 3 > winsup/cygwin/include/limits.h:#define _POSIX_TZNAME_MAX 6 > > Discussion of whether and how to define and align TZNAME_MAX values are > welcome: Cygwin punts and leaves it undefined, so developers have a choice > of using the alternatives unistd.h sysconf(_SC_TZNAME_MAX) or > _POSIX_TZNAME_MAX. > > I am inclined to use if defined in order: > * limits.h TZNAME_MAX > * unistd.h sysconf(_SC_TZNAME_MAX) if available > * limits.h _POSIX_TZNAME_MAX > * 6! I'd replace 6 with #error Corinna