在Linux2.6内核和NFSv3中
open("fname", O_CREAT|O_EXCL)
生效了吗?当前的规范
open(2)
http://www.kernel.org/doc/man-pages/online/pages/man2/open.2.html
)说一切都很好:
- O_EXCL
- ...
On NFS, O_EXCL is only supported when using NFSv3 or later on kernel
2.6 or later. In NFS environments where O_EXCL support is not
provided, programs that rely on it for performing locking tasks will
contain a race condition. Portable programs that want to perform
atomic file locking using a lockfile, and need to avoid reliance on NFS
support for O_EXCL, can ...
changelog
(ca late kernel 2.6.23)开始指示有效性
四年
2.6.0上线后,在过去一两年里,网络上充斥着各种各样的用户指责这种使用。我想在RHEL5(2.6.18)系统上使用此设置,但我无法确定它何时真正变得安全。有人有明确的答案吗?