Ignore:
Timestamp:
Sep 14, 2010, 2:30:30 AM (15 years ago)
Author:
bird
Message:

kash: implemented opendir/readdir/closedir for windows (NT). Fixed windows forking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shheap.c

    r2413 r2416  
    123123
    124124
    125 int shheap_init(void)
     125int shheap_init(void *phead)
    126126{
    127127    int rc;
     
    129129    SHHEAP_ASSERT(SHHEAP_ALIGN(sizeof(shmemhdr)) == sizeof(shmemhdr));
    130130    rc = shmtx_init(&g_sh_heap_mtx);
     131    g_sh_heap = (shmemchunk *)phead; /* non-zero on fork() */
    131132#else
    132133    rc = 0;
     
    138139
    139140# if K_OS == K_OS_WINDOWS
     141
     142/**
     143 * Get the head so the child can pass it to shheap_init() after fork().
     144 *
     145 * @returns g_sh_heap.
     146 */
     147void *shheap_get_head(void)
     148{
     149    return g_sh_heap;
     150}
     151
    140152/**
    141153 * Copies the heap into the child process.
     
    180192    return -1;
    181193}
    182 # endif
    183 
     194
     195# endif /* K_OS == K_OS_WINDOWS */
    184196
    185197/**
Note: See TracChangeset for help on using the changeset viewer.