Ignore:
Timestamp:
Aug 27, 2006, 4:26:13 PM (19 years ago)
Author:
bird
Message:

Fixed problems with fork() and module loading/unloading. Fixes #76.
Fixed atexit() and on_exit() problem with callbacks in unloaded DLLs. Fixes #103.

Location:
branches/libc-0.6/src/emx/include/InnoTekLIBC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/include/InnoTekLIBC/atexit.h

    r1905 r2786  
    3737    __LIBC_ATEXITTYPE_ONEXIT,
    3838    /** State transition state. */
    39     __LIBC_ATEXITTYPE_TRANS
     39    __LIBC_ATEXITTYPE_TRANS,
     40    /** The module containing the callback was unloaded. */
     41    __LIBC_ATEXITTYPE_UNLOADED
    4042} __LIBC_ATEXITTYPE;
    4143
     
    4749    /** Entry type. */
    4850    __LIBC_ATEXITTYPE volatile enmType;
     51    /** The (native) module handle this callback is connected to.
     52     * This will be 0 if no such association. */
     53    uintptr_t                  hmod;
    4954    union
    5055    {
     
    9297 * @returns Pointer to new entry.
    9398 * @returns NULL on failure.
     99 *
     100 * @param   pvCallback      The callback address.
     101 *                          This used to initialize the __LIBC_AT_EXIT::hmod field.
    94102 */
    95 __LIBC_PATEXIT __libc_atexit_new(void);
     103__LIBC_PATEXIT __libc_atexit_new(void *pvCallback);
     104
     105/**
     106 * Invalidate all atexit and on_exit callback for a
     107 * module which is being unloaded.
     108 *
     109 * @param   hmod        The module handle.
     110 */
     111void __libc_atexit_unload(uintptr_t hmod);
    96112
    97113__END_DECLS
  • branches/libc-0.6/src/emx/include/InnoTekLIBC/fork.h

    r2320 r2786  
    575575/** Indicates that the module is an executable. */
    576576#define __LIBC_FORKMODULE_FLAGS_EXECUTABLE      0x00000001
    577 /** Indicates that the module was dynamically loaded. */
    578 #define __LIBC_FORKMODULE_FLAGS_DYNAMIC         0x00010000
     577/** Indicates that the module already has been deregistered (libc termination). */
     578#define __LIBC_FORKMODULE_FLAGS_DEREGISTERED    0x00010000
    579579/** @} */
    580580
     
    606606 */
    607607int __libc_ForkRegisterModule(__LIBC_PFORKMODULE pModule, int fExecutable);
     608
     609
     610/**
     611 * Deregister a forkable module. Called by dll0.
     612 *
     613 * The call links pModule out of the list of forkable modules
     614 * which is maintained in the process block.
     615 *
     616 * @param   pModule     Pointer to the fork module structure for the
     617 *                      module which is to registered.
     618 */
     619void __libc_ForkDeregisterModule(__LIBC_PFORKMODULE pModule);
    608620
    609621
Note: See TracChangeset for help on using the changeset viewer.