• Poul-Henning Kamp's avatar
    Slightly polish the vmod loading/unloading code. · 731d2084
    Poul-Henning Kamp authored
    dlopen/dlclose(3) is deficient in at least two ways, possibly three:
    
    1. It assumes that if the path is the same, the file is the same.
       This makes it impossible to update VMODs in place by any means.
    
    2. It doesn't map the dlopen'ed object in copy-on-write mode.
       This makes things explode if you try anyway, without a rename-guard.
    
    3. It doesn't handle atexit(3) from dlopen(3)'ed code correctly on dlclose(3)
       This makes gcov(1) and friends explode.  The fault could be said to be
       on their part though:  atexit(3) from symlinked code is undefined.
    
    Since there is no sensible way to work around this, live with it, and
    rely on whatever check dlopen(3) uses for identity, rather than have
    our own name-comparison.
    731d2084
cache_vrt_vmod.c 4.89 KB