在thread.h中查找相关定义
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
/* Functions for handling read-write locks. */
/* Initialize read-write lock RWLOCK using attributes ATTR, or use
the default values if later is NULL. */
extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
__const pthread_rwlockattr_t *__restrict
__attr) __THROW __nonnull ((1));
最后查文档解决方是:
在程序开头加入:
#define _XOPEN_SOURCE 500