I'd be inclined to at least drop the parenthetic, it only
confuses things. The alternative would be to tie the
parenthetic to the FIFO and device files.
I'll grant that O_RDONLY would cause one to expect that the
file would not be modified in any way so truncating it on a
read-only seems wrong but that does fall under the
definition of undefined so is not contrary to the
documentation.
Anyone depending on undefined behaviour is asking for
trouble. Given that there is code floating around expecting
O_TRUNC|O_RDONLY to truncate, caution should be applied in
changing this.
I'd suggest replacing this text to match that of SUSv3 which
is much clearer. Perhaps with the addition of a clause
stating "The use of O_TRUNC in combination with O_RDONLY to
truncate files is deprecated" or something to that effect.
SUSv3:
| O_TRUNC
| If the file exists and is a regular file,
| and the file is successfully opened O_RDWR
| or O_WRONLY, its length shall be truncated
| to 0, and the mode and owner shall be
| unchanged. It shall have no effect on FIFO
| special files or terminal device files. Its
| effect on other file types is
| implementation-defined. The result of using
| O_TRUNC with O_RDONLY is undefined.
-- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.wsRemember Cernan and Schmitt - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/