スレッドスコープを取得するには、pthread_attr_getscope(3C) を使用します。
int pthread_attr_getscope(pthread_attr_t *restrict tattr, int *restrict scope);
#include <pthread.h> pthread_attr_t tattr; int scope; int ret; /* get scope of thread */ ret = pthread_attr_getscope(&tattr, &scope);
pthread_attr_getscope() は、正常終了時に 0 を返します。それ以外の戻り値は、エラーが発生したことを示します。以下の条件が検出されると、この関数は失敗し、対応する値を返します。
EINVAL
説明:scope の値が NULL か、tattr の値が無効です。