Re: [GENERAL] query log corrupted-looking entries

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: [GENERAL] query log corrupted-looking entries
Дата
Msg-id 52EF20B2E3209443BC37736D00C3C1380AE75E5D@EXADV1.host.magwien.gv.at
обсуждение исходный текст
Список pgsql-hackers
Tom Lane wrote:
> I checked around with some kernel/glibc gurus in Red Hat, and the
> consensus seemed to be that we'd be better off to bypass fprintf() and
> just send message strings to stderr using write() --- ie, instead of
> elog.c doing
>
>             fprintf(stderr, "%s", buf.data);
>
> do
>
>             write(fileno(stderr), buf.data, strlen(buf.data));
>
> Anyone have any comments on possible portability risks?  In
> particular, will this work on Windows?

The following program compiles and runs fine:

#include <stdio.h>
#include <unistd.h>
#include <string.h>

int main(int argc, char **argv) {
        const char *s="Hello!\n";

        write(fileno(stderr), s, strlen(s));
        return 0;
}

Yours,
Laurenz Albe

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Kirkwood
Дата:
Сообщение: Re: Asynchronous I/O Support
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: 8.1.4 verified on Intel Mac OS 10.4.8