This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]