[pgsql-jp: 35684] Re: pgpoolのfflush()におけるEAGAIN
SUGIMURA Takashi 杉村 貴士
sugimura @ yasudakei.org
2005年 7月 6日 (水) 22:31:58 JST
杉村です。
> > > 現状FreeBSD4.11、postgresql7.4.8でpgpoolを使用していますが、
EAGAIN についてはよくわからなかったのですが、
fflush() は 4.11 と 5.x以降 では少々実装が違うようです。
fflush.c を比べてみますと、次のようになっています。
http://www.jp.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdio/fflush.c
4.11 Sat Aug 28 00:00:58 1999 UTC
5.x〜 Sun Jul 4 20:17:00 2004 UTC
コメントで次のように書いてありました。
Linux では失敗しても成功を返して何もしないそうなのですが、
それもまたどうかと思います。
/*
* There is disagreement about the correct behaviour of fflush()
* when passed a file which is not open for reading. According to
* the ISO C standard, the behaviour is undefined.
* Under linux, such an fflush returns success and has no effect;
* under Windows, such an fflush is documented as behaving instead
* as fpurge().
* Given that applications may be written with the expectation of
* either of these two behaviours, the only safe (non-astonishing)
* option is to return EBADF and ask that applications be fixed.
*/
---
杉村 貴士 <sugimura @ YasudaKei.org>
GnuPG fingerprint: C81B 9835 1C9E BD9B 84BF 9785 0B91 D08B F667 DCED
pgsql-jp メーリングリストの案内