|
|
Subscribe / Log in / New account

Unix atomic actions, or how to replace an executable or library

Unix atomic actions, or how to replace an executable or library

Posted Aug 26, 2021 16:05 UTC (Thu) by davecb (subscriber, #1574)
In reply to: Unix atomic actions, or how to replace an executable or library by davecb
Parent article: The shrinking role of ETXTBSY

Just out of curiosity, does the Linux run-time linker decrement the i_writecount in the library inode? Solaris did...

If so, that suggests that Linux could have the same "you're about to mess up one of your processes" warning if someone inadvertently attempted to use cp or rsync to update an in-use library, just like an in-use program.


to post comments

Unix atomic actions, or how to replace an executable or library

Posted Sep 12, 2021 18:51 UTC (Sun) by nix (subscriber, #2304) [Link]

> Just out of curiosity, does the Linux run-time linker decrement the i_writecount in the library inode? Solaris did...

No. I'm fairly sure there is no way to do so: there was, but that was MAP_DENYWRITE, which, well, see this article... glibc is still careful to mmap its libraries with MAP_DENYWRITE, which the kernel then ignores :(


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds