Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If on Linux, with a good Linux file system (e.g. ext3 or ext4 or btrfs), you could update a shared library (e.g. <code>libfoo.so</code>) within a process and program (e.g. <code>bar</code>) using it (e.g. <code>dlopen</code>-ing that <code>libfoo.so</code>)</p> <p>You'll have preferably</p> <ol> <li>to <a href="http://linux.die.net/man/2/rename" rel="nofollow noreferrer">rename(2)</a> the old <code>libfoo.so</code> to e.g. <code>libfoo-old.so</code></li> <li>to <a href="http://linux.die.net/man/3/dlopen" rel="nofollow noreferrer">dlopen(3)</a> the new version of <code>libfoo.so</code></li> <li>to <code>dlsym</code> what you want inside it</li> <li>to perhaps <a href="http://linux.die.net/man/3/dlclose" rel="nofollow noreferrer">dlclose(3)</a> the old <code>dlopen</code>-ed handle to the old version; you can only do that if no active call frame points into the <code>libfoo-old.so</code> (otherwise your program will crash when returning into such call frames).</li> <li>to <a href="http://linux.die.net/man/2/unlink" rel="nofollow noreferrer">unlink(2)</a> the <code>libfoo-old.so</code> if needed</li> </ol> <p>(you could avoid <code>rename</code> and you could even <code>unlink</code> an active <code>dlopen</code>-ed library; the kernel would remove it if no further directory entry or process file descriptor points to it; I won't recommend that, e.g. to ease the debugging of potential <code>core</code> dumps).</p> <p>A simpler, but more "leaking" alternative, is to never <code>dlclose</code>. In practice, a program can <code>dlopen</code> many dozen of thousands <code>*.so</code> without fear. See my old <a href="http://starynkevitch.net/Basile/manydl.c" rel="nofollow noreferrer">manydl.c</a> example.</p> <p>Read also about <a href="https://en.wikipedia.org/wiki/Dynamic_software_updating" rel="nofollow noreferrer">dynamic software updating</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload