5 ms·
On Unix/Linux you can't update a file mmaped for execution either - text files are busy.
by formerly_proven 5y ago
On Unix/Linux you can't update a file mmaped for execution either - text files are busy.
- toast0 5y agoI've updated .so files on FreeBSD while they're running. They weren't busy and a program which had it mmaped to run promptly crashed (my update wasn't intended to be hot loaded and wasn't crafted to be safe, although, it could have been if I knew it was possible). And now I won't forget why I should use install instead of cp (install unlinks before writing, by default, cp opens and overwrites the existing file)
- AnssiH 5y agoIn my experience on Linux, shared libraries can be modified while running (often causing a crash), while executables cannot (ETXTBUSY).