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 ESMTPS id 2FD193857372 for ; Thu, 12 May 2022 07:59:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2FD193857372 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=1652342376; 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:in-reply-to:in-reply-to: references:references; bh=Lo+jVfzqJRA4pig0bhoiE+oQVGCDV9Z1GrUeEsuGEAc=; b=Jn4swaea/++PC/U6ARQ8dtlSdJ0ivwq2JjO35WKen82ha5aLpemdH2pedA3MRdrnNo2CV6 5OhNT1BsSchWkE3qIETh9OmbKReCyjlJnMneeGYLmOmODoDEBsuggNwcRwTHykDair5ACi 6z+z3WYet2JEKCXjhSp2Nq58A2cG0gQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-616-UiIQgtFFMTapFqe5PzkNOA-1; Thu, 12 May 2022 03:59:35 -0400 X-MC-Unique: UiIQgtFFMTapFqe5PzkNOA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2672D80419C for ; Thu, 12 May 2022 07:59:35 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F316E40CF91F for ; Thu, 12 May 2022 07:59:34 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id B98A1A80965; Thu, 12 May 2022 09:59:33 +0200 (CEST) Date: Thu, 12 May 2022 09:59:33 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: [PATCH 09/11] stdio: Replace _fwalk_reent() with _fwalk_sglue() Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220510080927.28839-1-matthew.joyce@embedded-brains.de> <20220510080927.28839-10-matthew.joyce@embedded-brains.de> <416bae8c-7fb1-774b-317a-473a9bf90180@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: <416bae8c-7fb1-774b-317a-473a9bf90180@embedded-brains.de> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Thu, 12 May 2022 07:59:38 -0000 On May 11 19:55, Sebastian Huber wrote: > On 11/05/2022 17:56, Corinna Vinschen wrote: > > On May 10 10:09, Matthew Joyce wrote: > > > From: Sebastian Huber > > > > > > Replaced _fwalk_reent() with _fwalk_sglue(). The change adds an > > > extra __sglue object as a parameter, which will allow the passing > > > of a global __sglue object separate from the __sglue member of > > > struct _reent. The global __sglue object will be added in a > > > follow-on patch. > > > --- > > > newlib/libc/stdio/fcloseall.c | 2 +- > > > newlib/libc/stdio/fflush.c | 2 +- > > > newlib/libc/stdio/findfp.c | 14 ++++++++++---- > > > newlib/libc/stdio/fwalk.c | 15 ++++++++------- > > > newlib/libc/stdio/local.h | 3 ++- > > > newlib/libc/stdio/refill.c | 4 ++-- > > > winsup/cygwin/syscalls.cc | 5 +++-- > > > 7 files changed, 27 insertions(+), 18 deletions(-) > > > [...] > > > diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc > > > index 1cecaa017..5bf6d8fc7 100644 > > > --- a/winsup/cygwin/syscalls.cc > > > +++ b/winsup/cygwin/syscalls.cc > > > @@ -3058,7 +3058,8 @@ _cygwin_istext_for_stdio (int fd) > > > } > > > /* internal newlib function */ > > > -extern "C" int _fwalk_reent (struct _reent *ptr, int (*function) (struct _reent *, FILE *)); > > > +extern "C" int _fwalk_sglue (struct _reent *ptr, > > > + int (*function) (struct _reent *, FILE *), struct _sglue *); > > ^^^^^^ > > _glue? > > In patch 8, Matthew added this: > > diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc > index 9b6c2509d..b7f624cc3 100644 > --- a/winsup/cygwin/signal.cc > +++ b/winsup/cygwin/signal.cc > @@ -22,6 +22,7 @@ details. */ > #include "cygheap.h" > #include "cygwait.h" > #include "posix_timer.h" > +#include "../../newlib/libc/stdio/local.h" > > This seems to work in the cygwin build. Should we remove the local > declaration and instead include the local.h header file? Actually, no. In fact, we should avoid direct access to private newlib headers from Cygwin entirely. As for the above error, it's just a typo and struct _glue is defined in sys/reeent anyway. As for definitions of __stdio_atexit (resp. stdio_exit_handler) or _fwalk_sglue... all definitions within newlib accessible from Cygwin should be in a system header, for instance sys/reeent or sys/stdio.h. Thanks, Corinna