I think flink() is good.
> Second is anon_open(dir, flags, mode). This call returns a file
> descriptor on an anonymous file, as if you had created a file and
> immediately unlinked it. (I'm not enamored of the function name.) The
> first argument is a hint as to where the file "belongs", so that it
> can allocate space in the right filesystem. For temporary files that
> would be /tmp or /var/tmp. The most obvious use is to avoid the races
> surrounding temporary file creation, which have been discussed at some
> length on the bugtraq list recently. In combination with flink(), it
> can be used to replace a file atomically, without having any time
> window where the new version isn't what you want it to be, or where a
> temporary name exists and might be grabbed by a malefactor.
This might be best done with open() flags. Add O_NOLINK or O_NONAME.
I think you still need a filename for the kernel internals,
but it could start out already unlinked.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu