[RFA] Remove set debug lin-lwp-async, new ui_file.to_write_async_safe

Pedro Alves pedro@codesourcery.com
Tue May 10 21:30:00 GMT 2011


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



More information about the Gdb-patches mailing list