aix 5.3 编译warning: thread_creds_t ……

 

写好的程序,在aix 6.1机器上可以编译能够通过并正常运行,移植到aix 5.3机器,编译通过,但提示   thread_creds_t  相关告警,忽略…… 结果程序一启动就会core掉,gdb提示访问非法内存。

很久一段时间没有找到解决方案,后来一想,会不会是编译过程中忽略的告警问题造成的。

查找资料,参考:https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000013821869 

 修改内核文件:/usr/include/sys/thread.h
        
           struct thread_credentials {
uint flags; /* Control structure data */
cred_ext_t cred; /* Credentials to be modified */
int reserved[9]; /* reserved fields for future */
} thread_creds_t;
 
 
增加 typedef,修改后:
typedef struct thread_credentials {
uint flags; /* Control structure data */
cred_ext_t cred; /* Credentials to be modified */
int reserved[9]; /* reserved fields for future */
} thread_creds_t;
 
对比aix 6.1上的/usr/include/sys/thread.h文件,果然也缺少了typedef,修改5.3机器上的代码, 编译,运行,一切正常。
posted @ 2017-03-27 17:59  331902579  阅读(121)  评论(0编辑  收藏  举报