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.133.124]) by sourceware.org (Postfix) with ESMTP id D16C4386197D for ; Wed, 28 Jul 2021 18:40:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D16C4386197D 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=1627497648; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=U6gZjbaEgGoP4ODr/7NL/nEkkpIw/VdJRU7nJDlc/38=; b=E94UK551v1fEigTiQsluCJkims4TuT1w3cRaXtfuJ/XCKDt21wRxK5lAUopqPX+LpGwFFW 7gUWfoW1HAbWzDkA92K9yWRC1ScU+i43rj5sUIFAZAgArYEOXsdx+kjOBY7uf2LJd6C4an KnJ/hwseuzMGdTQauZUFlGmP248geYY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-372-UExXpCYxMMWar6YXf-ngIg-1; Wed, 28 Jul 2021 14:40:44 -0400 X-MC-Unique: UExXpCYxMMWar6YXf-ngIg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFEB7193578B; Wed, 28 Jul 2021 18:40:43 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B542C5D6AB; Wed, 28 Jul 2021 18:40:43 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 4E392A80DED; Wed, 28 Jul 2021 20:40:42 +0200 (CEST) Date: Wed, 28 Jul 2021 20:40:42 +0200 From: Corinna Vinschen To: Matt Joyce Cc: newlib@sourceware.org Subject: Re: [PATCH 1/1] libc: Added implementations and prototypes for Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Matt Joyce , newlib@sourceware.org References: <20210724083730.16959-1-mfjoyce2004@gmail.com> <20210724083730.16959-2-mfjoyce2004@gmail.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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, 28 Jul 2021 18:40:50 -0000 On Jul 28 11:11, Corinna Vinschen wrote: > Hi Matt, > > thanks for this v2. > > On Jul 24 10:37, Matt Joyce wrote: > > Added implementations for sig2str() and str2sig() in libc/signal in order > > to improve POSIX compliance. Added function prototypes to sys/signal.h. > > Added Makefile.am entries to build the new file. > > --- > > [...] > > +#if __GNU_VISIBLE > > I think this needs discussion. The sig2str/str2sig API has not been > provided yet by GLibC. Using __GNU_VISIBLE in this context looks wrong. > What we need, in fact, is a __POSIX_VISIBLE guard, but here's the > problem: As far as I can see, the Issue 8 draft does not yet define a > version number. > > If anybody has better information or a good idea how to guard this new > API in the meantime, I'm all ears. > > > > > include $(srcdir)/../../Makefile.shared > > > > -CHEWOUT_FILES = psignal.def raise.def signal.def > > +CHEWOUT_FILES = psignal.def raise.def signal.def sig2str.def > > If you add this, you also have to provide a header allowing to create > a man page. See, for instance, newlib/signal/raise.c. > > > +int > > +sig2str(int signum, char *str) > > [...] > > + /* If signum is not a recognized signal number, store this message in str. */ > > + sprintf(str, "Unknown signal"); > > Just drop this sprintf, as I just wrote in my other mail. There's no > expectation that the incoming buffer gets changed if the function > returns with error. Additionally, there's a RATIONALE section in the draft, which describes how "historical versions of these functions translated a signum value 0 to "EXIT" (and vice versa), so that they could be used by the shell for the trap utility." While this isn't going to become part of the standard, I wonder if we should follow suite, for maximum compatibility. Corinna