From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13357 invoked by alias); 10 May 2011 21:30:42 -0000 Received: (qmail 13340 invoked by uid 22791); 10 May 2011 21:30:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 May 2011 21:30:27 +0000 Received: (qmail 17673 invoked from network); 10 May 2011 21:30:26 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 May 2011 21:30:26 -0000 From: Pedro Alves To: Doug Evans Subject: Re: [RFA] Remove set debug lin-lwp-async, new ui_file.to_write_async_safe Date: Tue, 10 May 2011 21:30:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <20110510204641.A4C73246199@ruffy.mtv.corp.google.com> In-Reply-To: <20110510204641.A4C73246199@ruffy.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201105102230.29758.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00261.txt.bz2 On Tuesday 10 May 2011 21:46:41, Doug Evans wrote: > static void > +stdio_file_write_async_safe (struct ui_file *file, > + const char *buf, long length_buf) > +{ > + struct stdio_file *stdio = ui_file_data (file); > + > + if (stdio->magic != &stdio_file_magic) > + { > + const char *msg = _("stdio_file_write_async_safe: bad magic number\n"); > + write (2, msg, strlen (msg)); > + return; > + } > + > + write (fileno (stdio->file), buf, length_buf); fileno is not required to be async signal safe by posix, AFAIK. (nor are strlen or _/gettext either). [gdbserver calls write/sizeof directly in linux-low.c, if you haven't seen it] -- Pedro Alves