bananan_wの日記: fcntl() ダメなのかー
日記 by
bananan_w
fcntl() の man 見てたんだけど、気になるところがあった。
F_SETFL
Set the file status flags part of the descriptor's flags to the
value specified by arg. Remaining bits (access mode, file cre-
ation flags) in arg are ignored. On Linux this command can only
change the O_APPEND, O_NONBLOCK, O_ASYNC, and O_DIRECT flags.
らすぃ。気になったのでカーネルソースを読んだ。/usr/src/linux/fs/fcntl.c ね。Version は 2.4.20(ふるー)
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC)
うん。だめぽ。close() して open() すりゃいいか。カッコ悪いけど。2.6 だとどうなのかなぁ。2.6.7 で見てみよう。
#define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | FASYNC | O_DIRECT)
O_DIRECT が増えているらしい。ふむぅ。
fcntl() ダメなのかー More ログイン