[M3devel] 5.8.6 LINUXLIBC6 breakage, kernel 2.6.23, glibc-2.6-4

Tony Hosking hosking at cs.purdue.edu
Tue Apr 19 00:11:26 CEST 2011


Probably unnecessary, given that I think there is another entry point to forking a process (I forget where) in the thread-specific portion of m3core.  In which case the necessary work might be done there?

On Apr 18, 2011, at 2:45 PM, Mika Nystrom wrote:

> Tony Hosking writes:
> ...
>> pthread_atfork should not be needed under user threads.
> ...
> 
> The following code from RTProcessC.c ensures that it is neeeded on every Unix except
> FreeBSD before 6.  The comment is from the checked-in source file.
> 
> /* NOTE: Even userthreads now depends
> * on availability of pthreads.
> * This can be fixed if need be.
> */
> 
> INTEGER
> __cdecl
> RTProcess__RegisterForkHandlers(
>    ForkHandler prepare,
>    ForkHandler parent,
>    ForkHandler child)
> {
> /* FreeBSD < 6 lacks pthread_atfork. Would be good to use autoconf.
> * VMS lacks pthread_atfork? Would be good to use autoconf.
> * Win32 lacks pthread_atfork and fork. OK.
> *
> * As well, for all Posix systems, we could implement
> * atfork ourselves, as long as we provide a fork()
> * wrapper that code uses.
> */
> #if defined(_WIN32) \
>        || defined(__vms) \
>        || (defined(__FreeBSD__) /* && (__FreeBSD__ < 6)*/ )
>    return 0;
> #else
>    while (1)
>    {
>      int i = pthread_atfork(prepare, parent, child);
>      if (i != EAGAIN)
>        return i;
>      sleep(0);
>    }
> #endif
> }




More information about the M3devel mailing list