Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Remove set debug lin-lwp-async, new ui_file.to_write_async_safe
Date: Tue, 10 May 2011 22:19:00 -0000	[thread overview]
Message-ID: <BANLkTin=DR9ELCGyOa3j_e8ibPCg9Aq9sA@mail.gmail.com> (raw)
In-Reply-To: <201105102230.29758.pedro@codesourcery.com>

On Tue, May 10, 2011 at 2:30 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> 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).

If it became an issue, one could record fileno ahead of time.
For gettext(), I'd be happy with just removing it for this particular case.

> [gdbserver calls write/sizeof directly in linux-low.c,
>  if you haven't seen it]

Yeah.


  reply	other threads:[~2011-05-10 22:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 20:47 Doug Evans
2011-05-10 20:51 ` Doug Evans
2011-05-10 21:30 ` Pedro Alves
2011-05-10 22:19   ` Doug Evans [this message]
2011-05-11  7:39     ` Jan Kratochvil
2011-05-11 15:50       ` Doug Evans
2011-05-13 17:32         ` Doug Evans
2011-05-13 19:05           ` Stan Shebs
2011-05-14  5:45             ` Doug Evans
2011-05-10 21:38 ` Pedro Alves
2011-05-10 22:20   ` Doug Evans
2011-05-11  2:50 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTin=DR9ELCGyOa3j_e8ibPCg9Aq9sA@mail.gmail.com' \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox