How to get POSIX strerror_r instead of GNU version?

后端 未结 3 2072
醉话见心
醉话见心 2020-12-16 01:18

How do I get the POSIX strerror_r instead of GNU version?

I\'m compiling with g++ on Ubuntu 8.04 with glibc version 2.7 ( based on what\'s in ).

Edi

3条回答
  •  无人及你
    2020-12-16 01:49

    This is an implementation-specific workaround.

    #ifdef __cplusplus
    extern "C"
        {
    #endif
        extern 
        int __xpg_strerror_r(int errcode,char* buffer,size_t length);
        #define strerror_r __xpg_strerror_r
    
    #ifdef __cplusplus
        }
    #endif
    

提交回复
热议问题