Replace fork with try_fork in testsuite?

Mark Mitchell mark@codesourcery.com
Thu May 5 17:09:00 GMT 2005


Paolo Carlini wrote:
> Benjamin Kosnik wrote:
> 
> 
>>>Maybe you want also to have a look to
>>>libstdc++/19781 (talking of try_mkfifo and mkfifo: maybe we can do better)?
>>>   
>>>
>>
>>We could just test for mkfifo and fork directly as part of configure,
>>and use _GLIBCXXX_HAVE_MKFIFO and _GLIBCXX_HAVE_FORK.
>>
> 
> Indeed, something along this way should work. But I don't want to
> interfere with Mark's plans and, anyway, definitely cannot do the work
> *right now*...

It's just a detail of how we actually handle the #ifdef-ery.  I can add 
the proper configure magic, if people consider that preferable to the 
try_mkfifo approach, which is just:

#if defined (_NEWLIB_VERSION) || defined (__MINGW32_VERSION)
     /* Newlib and MinGW32 do not have mkfifo.  */
     exit(0);
#else
     return mkfifo(filename, mode);
#endif

If you want me to add HAVE_{MKFIFO,FORK} let me know, and I'll fix 
try_mkfifo while I'm at it.  This will mean, however, that these defines 
end up in c++config.h, even though they'll be unused in the library proper.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Libstdc++ mailing list