Well the man page may be a little obscure.
'cp new_libc.so libc.so' or 'cat new_libc.so > libc.so' would overwrite the
inode of the old libc.so using write() so that running binaries would crash.
rename("new_libc.so","libc.so") does not overwrite the inode of the old
libc.so. The old inode will exist unmodified until it will be deleted when
all the binaries using it have finished (if libc.so was the only link). You
could even do
link("libc.so","backup_libc.so");rename("new_libc.so","libc.so") to save a
perfectly working backup copy of the old libc. What the man page means by
overwriting is that rename() only overwrites the directory entry of libc.so
so that it points to the inode of the new libc.so. This overwriting is done
atomically so that there is no moment when the directory entry 'libc.so'
would not point to either version of the library. But it does not affect the
contents of the inodes in question.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html