Re: Unportability of setvbuf()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Unportability of setvbuf()
Дата
Msg-id 28070.1400171943@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Unportability of setvbuf()  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Tom Lane wrote:
>> It might also be reasonable to create a wrapper macro along the line of
>> "PG_STD_IO_BUFFERING()" that would encapsulate the whole sequence
>> setvbuf(stdout, NULL, _IOLBF, 0);
>> setvbuf(stderr, NULL, _IONBF, 0);
>> Or maybe we should have separate macros for those two calls.  Or maybe
>> this is just a useless layer of abstraction and PG_IOLBF is enough
>> to make the calls portable.
>> 
>> Thoughts?

> I don't really know all that much about this stuff, but see commits
> 6eda3e9c27781dec369542a9b20cba7c3d832a5e and its parent about
> isolationtester.

Yeah, making them both unbuffered is another scenario that has its
use-cases, so maybe it's inappropriate to create a macro that presumes
to define the One True Way.

For the moment I'll just arrange for initdb to share the logic with
syslogger.
        regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers
Следующее
От: "Tomas Vondra"
Дата:
Сообщение: buildfarm animals and 'snapshot too old'