Solaris10だとマルチスレッドアプリでも、libthreadもlibpthreadもリンクする必要ない!!

マルチスレッドプログラムのコンパイルとリンク

Solaris 10 リリースと Solaris 9 リリースのコンパイルとリンクには同じコマンドを使用できますが、次のいくつかの相違点を考慮するようにしてください。

Solaris 10 リリースでは、すべてのスレッド関数が libc ライブラリに含まれているため、明示的に libthread または libpthread ライブラリにリンクする必要はありません。

うそーん。知りませんせんでした。

実験

マルチスレッドアプリでlibthreadをリンクなしで動作するか実験
(懐かしいなこれ、初めて作ったマルチスレッドアプリだ。)

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <thread.h>
#include <unistd.h>
#include <string.h>

void *counter(void *arg){
  int     i;
  pid_t   pid;
  thread_t  thread_id;

    pid=getpid();
    thread_id=thr_self();

    for(i=0;i<10;i++){
        sleep(1);
        printf("pid=[%d], thread_id=[%d], counter=%d\n", pid, thread_id, i);
    }

    return(arg);
}

int main( int argc, char* argv[]){
    pid_t   p_pid;
    thread_t  thread_id1, thread_id2, thread_main;
    int  status;
    void   *result;

    p_pid=getpid();
    printf("[%d]start\n", p_pid);

    thread_main=thr_self();
    printf("main thread id =%d\n", thread_main);
    status=thr_create((void*)NULL, 0, counter, (void *)NULL,0 ,&thread_id1);
    if(status!=0){
        fprintf(stderr, "thr_create : %s\n", strerror(status));
    }else{
        printf("[%d]thread_id1=%d\n", p_pid, thread_id1);
    }

    status=thr_create((void*)NULL, 0, counter, (void *)NULL,0 ,&thread_id2);
    if(status!=0){
      fprintf(stderr, "thr_create : %s\n", strerror(status));
    }else{
      printf("[%d]thread_id2=%d\n", p_pid, thread_id2);
    }

    thr_join(thread_id1, NULL, &result);
    printf("[%d]thread_id1 = %d end\n", p_pid, thread_id1);
    thr_join(thread_id2, NULL, &result);
    printf("[%d]thread_id2 = %d end\n", p_pid, thread_id2);
    printf("[%d]end\n", p_pid);
    return 0;
}
コンパイル
[oc@sol10 thread]$ cc -o thread_sample thread_sample.c
リンクされているライブラリの確認
[oc@sol10 thread]$ ldd thread_sample
        libc.so.1 =>     /lib/libc.so.1
        libm.so.2 =>     /lib/libm.so.2
        /platform/FJSV,GPUZC-M/lib/libc_psr.so.1
動作確認
[oc@sol10 thread]$ thread_sample
[6003]start
main thread id =1
[6003]thread_id1=2
[6003]thread_id2=3
pid=[6003], thread_id=[3], counter=0
pid=[6003], thread_id=[2], counter=0
pid=[6003], thread_id=[2], counter=1
pid=[6003], thread_id=[3], counter=1
pid=[6003], thread_id=[2], counter=2
pid=[6003], thread_id=[3], counter=2
pid=[6003], thread_id=[2], counter=3
pid=[6003], thread_id=[3], counter=3
pid=[6003], thread_id=[2], counter=4
pid=[6003], thread_id=[3], counter=4
pid=[6003], thread_id=[2], counter=5
pid=[6003], thread_id=[3], counter=5
pid=[6003], thread_id=[2], counter=6
pid=[6003], thread_id=[3], counter=6
^C

確かにリンクせずに動作するようだ。

Solaris9だと

コンパイルはできるけど、リンクして無いと動作時にエラーになる。

[oc@sol9 thread]$ /opt/SUNWspro/bin/cc -o thread_sample thread_sample.c
[oc@sol9 thread]$ thread_sample
[19072]start
main thread id =1
thr_create : Unknown error
thr_create : Unknown error
[19072]thread_id1 = 0 end
[19072]thread_id2 = 0 end
[19072]end

のぉー、errno出力してないし。。。
誰だこんなアプリ作ったのは( ̄▽ ̄;)

[oc@sol9 thread]$ ldd thread_sample
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1

ライブラリのシンボルの違い

Solaris10のlibcのライブラリにあるスレッド系のシンボル
[oc@sol10 thread]$ nm /usr/lib/libc.so.1|grep thread
[7860]  |    969540|       4|OBJT |GLOB |0    |18     |__libc_threaded
[8189]  |    781620|      20|FUNC |GLOB |0    |9      |__nthreads
[8411]  |    720068|      40|FUNC |GLOB |0    |9      |__pthread_cleanup_pop
[6425]  |    720040|      28|FUNC |GLOB |0    |9      |__pthread_cleanup_push
[8672]  |    781600|       8|FUNC |WEAK |0    |9      |__pthread_min_stack
[6808]  |    969536|       4|OBJT |GLOB |0    |18     |__threaded
[158]   |    265540|     196|FUNC |LOCL |2    |9      |_private_pthread_atfork
[6632]  |    265540|     196|FUNC |GLOB |0    |9      |_pthread_atfork
[6462]  |    720252|      60|FUNC |GLOB |0    |9      |_pthread_attr_destroy
[6745]  |    720604|      60|FUNC |GLOB |0    |9      |_pthread_attr_getdetachstate
[7657]  |    721288|      60|FUNC |GLOB |0    |9      |_pthread_attr_getguardsize
[7465]  |    720852|      60|FUNC |GLOB |0    |9      |_pthread_attr_getinheritsched
[7486]  |    721180|      60|FUNC |GLOB |0    |9      |_pthread_attr_getschedparam
[8790]  |    720984|      60|FUNC |GLOB |0    |9      |_pthread_attr_getschedpolicy
[6671]  |    720728|      60|FUNC |GLOB |0    |9      |_pthread_attr_getscope
[7531]  |    721412|      76|FUNC |GLOB |0    |9      |_pthread_attr_getstack
[6865]  |    720480|      60|FUNC |GLOB |0    |9      |_pthread_attr_getstackaddr
[6881]  |    720372|      60|FUNC |GLOB |0    |9      |_pthread_attr_getstacksize
[6822]  |    720108|     144|FUNC |GLOB |0    |9      |_pthread_attr_init
[7450]  |    720540|      64|FUNC |GLOB |0    |9      |_pthread_attr_setdetachstate
[6204]  |    721240|      48|FUNC |GLOB |0    |9      |_pthread_attr_setguardsize
[6893]  |    720788|      64|FUNC |GLOB |0    |9      |_pthread_attr_setinheritsched
[6625]  |    721044|     136|FUNC |GLOB |0    |9      |_pthread_attr_setschedparam
[8107]  |    720912|      72|FUNC |GLOB |0    |9      |_pthread_attr_setschedpolicy
[7394]  |    720664|      64|FUNC |GLOB |0    |9      |_pthread_attr_setscope
[7861]  |    721348|      64|FUNC |GLOB |0    |9      |_pthread_attr_setstack
[6421]  |    720432|      48|FUNC |GLOB |0    |9      |_pthread_attr_setstackaddr
[6434]  |    720312|      60|FUNC |GLOB |0    |9      |_pthread_attr_setstacksize
[8053]  |    721880|      48|FUNC |GLOB |0    |9      |_pthread_barrier_destroy
[6709]  |    721716|     164|FUNC |GLOB |0    |9      |_pthread_barrier_init
[6053]  |    721928|     156|FUNC |GLOB |0    |9      |_pthread_barrier_wait
[7443]  |    721532|      60|FUNC |GLOB |0    |9      |_pthread_barrierattr_destroy
[7703]  |    721656|      60|FUNC |GLOB |0    |9      |_pthread_barrierattr_getpshared
[6849]  |    721488|      44|FUNC |GLOB |0    |9      |_pthread_barrierattr_init
[6878]  |    721592|      64|FUNC |GLOB |0    |9      |_pthread_barrierattr_setpshared
[7090]  |    718892|     296|FUNC |GLOB |0    |9      |_pthread_cancel
[6609]  |    766156|     736|FUNC |WEAK |0    |9      |_pthread_cond_broadcast
[6480]  |    766892|      24|FUNC |WEAK |0    |9      |_pthread_cond_destroy
[8744]  |    722444|     124|FUNC |GLOB |0    |9      |_pthread_cond_init
[7483]  |    765456|      60|FUNC |GLOB |0    |9      |_pthread_cond_reltimedwait_np
[8117]  |    765516|     640|FUNC |WEAK |0    |9      |_pthread_cond_signal
[7215]  |    765280|      60|FUNC |GLOB |0    |9      |_pthread_cond_timedwait
[6415]  |    764892|      40|FUNC |GLOB |0    |9      |_pthread_cond_wait
[7676]  |    722136|      60|FUNC |GLOB |0    |9      |_pthread_condattr_destroy
[6818]  |    722260|      60|FUNC |GLOB |0    |9      |_pthread_condattr_getclock
[6581]  |    722384|      60|FUNC |GLOB |0    |9      |_pthread_condattr_getpshared
[7305]  |    722084|      52|FUNC |GLOB |0    |9      |_pthread_condattr_init
[7019]  |    722196|      64|FUNC |GLOB |0    |9      |_pthread_condattr_setclock
[7341]  |    722320|      64|FUNC |GLOB |0    |9      |_pthread_condattr_setpshared
[7634]  |    724084|     664|FUNC |GLOB |0    |9      |_pthread_create
[7992]  |    774864|     164|FUNC |WEAK |0    |9      |_pthread_detach
[7638]  |    724896|      16|FUNC |GLOB |0    |9      |_pthread_equal
[7070]  |    774360|      16|FUNC |WEAK |0    |9      |_pthread_exit
[6832]  |    781368|      36|FUNC |GLOB |0    |9      |_pthread_getconcurrency
[6771]  |    724912|     140|FUNC |GLOB |0    |9      |_pthread_getschedparam
[8428]  |    786028|      72|FUNC |GLOB |0    |9      |_pthread_getspecific
[7469]  |    774824|      40|FUNC |GLOB |0    |9      |_pthread_join
[8560]  |    785672|     260|FUNC |WEAK |0    |9      |_pthread_key_create
[7539]  |    785932|      96|FUNC |WEAK |0    |9      |_pthread_key_delete
[6754]  |    780820|      28|FUNC |WEAK |0    |9      |_pthread_kill
[8648]  |    723208|      84|FUNC |GLOB |0    |9      |_pthread_mutex_consistent_np
[7917]  |    762420|      44|FUNC |WEAK |0    |9      |_pthread_mutex_destroy
[7041]  |    723584|      16|FUNC |GLOB |0    |9      |_pthread_mutex_getprioceiling
[8370]  |    723292|     188|FUNC |GLOB |0    |9      |_pthread_mutex_init
[6095]  |    759584|      16|FUNC |WEAK |0    |9      |_pthread_mutex_lock
[6154]  |    759656|      56|FUNC |GLOB |0    |9      |_pthread_mutex_reltimedlock_np
[7223]  |    723480|     104|FUNC |GLOB |0    |9      |_pthread_mutex_setprioceiling
[6507]  |    759600|      56|FUNC |GLOB |0    |9      |_pthread_mutex_timedlock
[8643]  |    759864|     416|FUNC |WEAK |0    |9      |_pthread_mutex_trylock
[7388]  |    760928|     768|FUNC |WEAK |0    |9      |_pthread_mutex_unlock
[7315]  |    722628|      60|FUNC |GLOB |0    |9      |_pthread_mutexattr_destroy
[7435]  |    722884|      60|FUNC |GLOB |0    |9      |_pthread_mutexattr_getprioceiling
[8052]  |    723024|      60|FUNC |GLOB |0    |9      |_pthread_mutexattr_getprotocol
[7610]  |    722752|      60|FUNC |GLOB |0    |9      |_pthread_mutexattr_getpshared
[7780]  |    723148|      60|FUNC |GLOB |0    |9      |_pthread_mutexattr_getrobust_np
[7139]  |    723688|     104|FUNC |GLOB |0    |9      |_pthread_mutexattr_gettype
[8447]  |    722568|      60|FUNC |GLOB |0    |9      |_pthread_mutexattr_init
[6723]  |    722812|      72|FUNC |GLOB |0    |9      |_pthread_mutexattr_setprioceiling
[7316]  |    722944|      80|FUNC |GLOB |0    |9      |_pthread_mutexattr_setprotocol
[6866]  |    722688|      64|FUNC |GLOB |0    |9      |_pthread_mutexattr_setpshared
[8250]  |    723084|      64|FUNC |GLOB |0    |9      |_pthread_mutexattr_setrobust_np
[6331]  |    723600|      88|FUNC |GLOB |0    |9      |_pthread_mutexattr_settype
[6713]  |    724748|     148|FUNC |GLOB |0    |9      |_pthread_once
[8667]  |    727924|      56|FUNC |WEAK |0    |9      |_pthread_rwlock_destroy
[7142]  |    724020|      64|FUNC |GLOB |0    |9      |_pthread_rwlock_init
[5987]  |    729956|      16|FUNC |WEAK |0    |9      |_pthread_rwlock_rdlock
[7351]  |    730000|      56|FUNC |GLOB |0    |9      |_pthread_rwlock_reltimedrdlock_np
[7697]  |    730472|      56|FUNC |GLOB |0    |9      |_pthread_rwlock_reltimedwrlock_np
[8464]  |    730056|      56|FUNC |GLOB |0    |9      |_pthread_rwlock_timedrdlock
[7646]  |    730528|      56|FUNC |GLOB |0    |9      |_pthread_rwlock_timedwrlock
[7778]  |    730584|     292|FUNC |WEAK |0    |9      |_pthread_rwlock_tryrdlock
[8556]  |    730876|     220|FUNC |WEAK |0    |9      |_pthread_rwlock_trywrlock
[7397]  |    731096|     716|FUNC |WEAK |0    |9      |_pthread_rwlock_unlock
[6760]  |    730428|      16|FUNC |WEAK |0    |9      |_pthread_rwlock_wrlock
[7238]  |    723836|      60|FUNC |GLOB |0    |9      |_pthread_rwlockattr_destroy
[8078]  |    723960|      60|FUNC |GLOB |0    |9      |_pthread_rwlockattr_getpshared
[8716]  |    723792|      44|FUNC |GLOB |0    |9      |_pthread_rwlockattr_init
[7245]  |    723896|      64|FUNC |GLOB |0    |9      |_pthread_rwlockattr_setpshared
[7323]  |    778904|       8|FUNC |WEAK |0    |9      |_pthread_self
[7687]  |    719188|     280|FUNC |GLOB |0    |9      |_pthread_setcancelstate
[7643]  |    719468|     356|FUNC |GLOB |0    |9      |_pthread_setcanceltype
[8501]  |    773092|      40|FUNC |GLOB |0    |9      |_pthread_setcleanupinit
[6124]  |    781524|      76|FUNC |GLOB |0    |9      |_pthread_setconcurrency
[8773]  |    725588|      16|FUNC |GLOB |0    |9      |_pthread_setschedparam
[8687]  |    778764|      52|FUNC |WEAK |0    |9      |_pthread_setschedprio
[6481]  |    786384|     188|FUNC |WEAK |0    |9      |_pthread_setspecific
[6354]  |    745056|     456|FUNC |WEAK |0    |9      |_pthread_sigmask
[8256]  |    762544|      28|FUNC |GLOB |0    |9      |_pthread_spin_destroy
[6794]  |    762464|      80|FUNC |GLOB |0    |9      |_pthread_spin_init
[8461]  |    762688|      52|FUNC |GLOB |0    |9      |_pthread_spin_lock
[7812]  |    762572|     116|FUNC |GLOB |0    |9      |_pthread_spin_trylock
[7940]  |    762740|      96|FUNC |GLOB |0    |9      |_pthread_spin_unlock
[8044]  |    719824|      52|FUNC |GLOB |0    |9      |_pthread_testcancel
[5705]  |    783972|       8|FUNC |LOCL |0    |9      |_thread_probe_getfunc
[343]   |    725052|     536|FUNC |LOCL |2    |9      |_thread_setschedparam_main
[5444]  |    969328|       4|OBJT |LOCL |0    |18     |assert_thread
[1924]  |    293808|      44|FUNC |LOCL |0    |9      |destroy_thread_data
[102]   |    983232|       4|OBJT |LOCL |2    |21     |panic_thread
[5522]  |         0|       0|FILE |LOCL |0    |ABS    |pthread.c
[8176]  |    265540|     196|FUNC |WEAK |0    |9      |pthread_atfork
[8684]  |    720252|      60|FUNC |WEAK |0    |9      |pthread_attr_destroy
[6056]  |    720604|      60|FUNC |WEAK |0    |9      |pthread_attr_getdetachstate
[6198]  |    721288|      60|FUNC |WEAK |0    |9      |pthread_attr_getguardsize
[6532]  |    720852|      60|FUNC |WEAK |0    |9      |pthread_attr_getinheritsched
[6508]  |    721180|      60|FUNC |WEAK |0    |9      |pthread_attr_getschedparam
[6075]  |    720984|      60|FUNC |WEAK |0    |9      |pthread_attr_getschedpolicy
[7836]  |    720728|      60|FUNC |WEAK |0    |9      |pthread_attr_getscope
[8209]  |    721412|      76|FUNC |WEAK |0    |9      |pthread_attr_getstack
[8263]  |    720480|      60|FUNC |WEAK |0    |9      |pthread_attr_getstackaddr
[6182]  |    720372|      60|FUNC |WEAK |0    |9      |pthread_attr_getstacksize
[6047]  |    720108|     144|FUNC |WEAK |0    |9      |pthread_attr_init
[6750]  |    720540|      64|FUNC |WEAK |0    |9      |pthread_attr_setdetachstate
[7595]  |    721240|      48|FUNC |WEAK |0    |9      |pthread_attr_setguardsize
[8776]  |    720788|      64|FUNC |WEAK |0    |9      |pthread_attr_setinheritsched
[8496]  |    721044|     136|FUNC |WEAK |0    |9      |pthread_attr_setschedparam
[8258]  |    720912|      72|FUNC |WEAK |0    |9      |pthread_attr_setschedpolicy
[8542]  |    720664|      64|FUNC |WEAK |0    |9      |pthread_attr_setscope
[8503]  |    721348|      64|FUNC |WEAK |0    |9      |pthread_attr_setstack
[7794]  |    720432|      48|FUNC |WEAK |0    |9      |pthread_attr_setstackaddr
[8607]  |    720312|      60|FUNC |WEAK |0    |9      |pthread_attr_setstacksize
[8485]  |    721880|      48|FUNC |WEAK |0    |9      |pthread_barrier_destroy
[6097]  |    721716|     164|FUNC |WEAK |0    |9      |pthread_barrier_init
[8075]  |    721928|     156|FUNC |WEAK |0    |9      |pthread_barrier_wait
[6273]  |    721532|      60|FUNC |WEAK |0    |9      |pthread_barrierattr_destroy
[8536]  |    721656|      60|FUNC |WEAK |0    |9      |pthread_barrierattr_getpshared
[8678]  |    721488|      44|FUNC |WEAK |0    |9      |pthread_barrierattr_init
[7693]  |    721592|      64|FUNC |WEAK |0    |9      |pthread_barrierattr_setpshared
[6246]  |    718892|     296|FUNC |WEAK |0    |9      |pthread_cancel
[5707]  |    983168|       4|OBJT |LOCL |0    |21     |pthread_concurrency
[7423]  |    766156|     736|FUNC |WEAK |0    |9      |pthread_cond_broadcast
[6377]  |    766892|      24|FUNC |WEAK |0    |9      |pthread_cond_destroy
[8381]  |    722444|     124|FUNC |WEAK |0    |9      |pthread_cond_init
[8702]  |    765456|      60|FUNC |WEAK |0    |9      |pthread_cond_reltimedwait_np
[7562]  |    765516|     640|FUNC |WEAK |0    |9      |pthread_cond_signal
[6072]  |    765280|      60|FUNC |WEAK |0    |9      |pthread_cond_timedwait
[6011]  |    764892|      40|FUNC |WEAK |0    |9      |pthread_cond_wait
[8631]  |    722136|      60|FUNC |WEAK |0    |9      |pthread_condattr_destroy
[8369]  |    722260|      60|FUNC |WEAK |0    |9      |pthread_condattr_getclock
[7748]  |    722384|      60|FUNC |WEAK |0    |9      |pthread_condattr_getpshared
[8621]  |    722084|      52|FUNC |WEAK |0    |9      |pthread_condattr_init
[7494]  |    722196|      64|FUNC |WEAK |0    |9      |pthread_condattr_setclock
[8389]  |    722320|      64|FUNC |WEAK |0    |9      |pthread_condattr_setpshared
[8489]  |    724084|     664|FUNC |WEAK |0    |9      |pthread_create
[6483]  |    774864|     164|FUNC |WEAK |0    |9      |pthread_detach
[6128]  |    724896|      16|FUNC |WEAK |0    |9      |pthread_equal
[7952]  |    774360|      16|FUNC |WEAK |0    |9      |pthread_exit
[7482]  |    781368|      36|FUNC |WEAK |0    |9      |pthread_getconcurrency
[7803]  |    724912|     140|FUNC |WEAK |0    |9      |pthread_getschedparam
[6081]  |    786028|      72|FUNC |WEAK |0    |9      |pthread_getspecific
[8456]  |    774824|      40|FUNC |WEAK |0    |9      |pthread_join
[8460]  |    785672|     260|FUNC |WEAK |0    |9      |pthread_key_create
[7414]  |    785932|      96|FUNC |WEAK |0    |9      |pthread_key_delete
[7570]  |    780820|      28|FUNC |WEAK |0    |9      |pthread_kill
[8345]  |    723208|      84|FUNC |WEAK |0    |9      |pthread_mutex_consistent_np
[6387]  |    762420|      44|FUNC |WEAK |0    |9      |pthread_mutex_destroy
[7774]  |    723584|      16|FUNC |WEAK |0    |9      |pthread_mutex_getprioceiling
[6312]  |    723292|     188|FUNC |WEAK |0    |9      |pthread_mutex_init
[6921]  |    759584|      16|FUNC |WEAK |0    |9      |pthread_mutex_lock
[8275]  |    759656|      56|FUNC |WEAK |0    |9      |pthread_mutex_reltimedlock_np
[7960]  |    723480|     104|FUNC |WEAK |0    |9      |pthread_mutex_setprioceiling
[7738]  |    759600|      56|FUNC |WEAK |0    |9      |pthread_mutex_timedlock
[6453]  |    759864|     416|FUNC |WEAK |0    |9      |pthread_mutex_trylock
[6985]  |    760928|     768|FUNC |WEAK |0    |9      |pthread_mutex_unlock
[6018]  |    722628|      60|FUNC |WEAK |0    |9      |pthread_mutexattr_destroy
[6304]  |    722884|      60|FUNC |WEAK |0    |9      |pthread_mutexattr_getprioceiling
[8096]  |    723024|      60|FUNC |WEAK |0    |9      |pthread_mutexattr_getprotocol
[6890]  |    722752|      60|FUNC |WEAK |0    |9      |pthread_mutexattr_getpshared
[8782]  |    723148|      60|FUNC |WEAK |0    |9      |pthread_mutexattr_getrobust_np
[8686]  |    723688|     104|FUNC |WEAK |0    |9      |pthread_mutexattr_gettype
[7829]  |    722568|      60|FUNC |WEAK |0    |9      |pthread_mutexattr_init
[7136]  |    722812|      72|FUNC |WEAK |0    |9      |pthread_mutexattr_setprioceiling
[8538]  |    722944|      80|FUNC |WEAK |0    |9      |pthread_mutexattr_setprotocol
[6192]  |    722688|      64|FUNC |WEAK |0    |9      |pthread_mutexattr_setpshared
[7387]  |    723084|      64|FUNC |WEAK |0    |9      |pthread_mutexattr_setrobust_np
[7854]  |    723600|      88|FUNC |WEAK |0    |9      |pthread_mutexattr_settype
[7592]  |    724748|     148|FUNC |WEAK |0    |9      |pthread_once
[7404]  |    727924|      56|FUNC |WEAK |0    |9      |pthread_rwlock_destroy
[8132]  |    724020|      64|FUNC |WEAK |0    |9      |pthread_rwlock_init
[8236]  |    729956|      16|FUNC |WEAK |0    |9      |pthread_rwlock_rdlock
[7285]  |    730000|      56|FUNC |WEAK |0    |9      |pthread_rwlock_reltimedrdlock_np
[7624]  |    730472|      56|FUNC |WEAK |0    |9      |pthread_rwlock_reltimedwrlock_np
[8288]  |    730056|      56|FUNC |WEAK |0    |9      |pthread_rwlock_timedrdlock
[7615]  |    730528|      56|FUNC |WEAK |0    |9      |pthread_rwlock_timedwrlock
[6753]  |    730584|     292|FUNC |WEAK |0    |9      |pthread_rwlock_tryrdlock
[7530]  |    730876|     220|FUNC |WEAK |0    |9      |pthread_rwlock_trywrlock
[7678]  |    731096|     716|FUNC |WEAK |0    |9      |pthread_rwlock_unlock
[8813]  |    730428|      16|FUNC |WEAK |0    |9      |pthread_rwlock_wrlock
[7997]  |    723836|      60|FUNC |WEAK |0    |9      |pthread_rwlockattr_destroy
[6834]  |    723960|      60|FUNC |WEAK |0    |9      |pthread_rwlockattr_getpshared
[7129]  |    723792|      44|FUNC |WEAK |0    |9      |pthread_rwlockattr_init
[5990]  |    723896|      64|FUNC |WEAK |0    |9      |pthread_rwlockattr_setpshared
[8182]  |    778904|       8|FUNC |WEAK |0    |9      |pthread_self
[5983]  |    719188|     280|FUNC |WEAK |0    |9      |pthread_setcancelstate
[6490]  |    719468|     356|FUNC |WEAK |0    |9      |pthread_setcanceltype
[6790]  |    781524|      76|FUNC |WEAK |0    |9      |pthread_setconcurrency
[6958]  |    725588|      16|FUNC |WEAK |0    |9      |pthread_setschedparam
[7871]  |    778764|      52|FUNC |WEAK |0    |9      |pthread_setschedprio
[7012]  |    786384|     188|FUNC |WEAK |0    |9      |pthread_setspecific
[7372]  |    745056|     456|FUNC |WEAK |0    |9      |pthread_sigmask
[7390]  |    762544|      28|FUNC |WEAK |0    |9      |pthread_spin_destroy
[7212]  |    762464|      80|FUNC |WEAK |0    |9      |pthread_spin_init
[5995]  |    762688|      52|FUNC |WEAK |0    |9      |pthread_spin_lock
[8326]  |    762572|     116|FUNC |WEAK |0    |9      |pthread_spin_trylock
[6437]  |    762740|      96|FUNC |WEAK |0    |9      |pthread_spin_unlock
[6091]  |    719824|      52|FUNC |WEAK |0    |9      |pthread_testcancel
[50]    |    787736|       8|FUNC |LOCL |2    |9      |set_curthread
[5717]  |    775864|     188|FUNC |LOCL |0    |9      |set_thread_vars
[185]   |    969464|       4|OBJT |LOCL |2    |18     |thread_adaptive_spin
[151]   |    974044|       4|OBJT |LOCL |2    |18     |thread_async_safe
[358]   |    974036|       4|OBJT |LOCL |2    |18     |thread_cond_wait_defer
[707]   |    718092|     420|FUNC |LOCL |2    |9      |thread_error
[674]   |    974040|       4|OBJT |LOCL |2    |18     |thread_error_detection
[5719]  |         0|       0|FILE |LOCL |0    |ABS    |thread_interface.c
[257]   |    969468|       4|OBJT |LOCL |2    |18     |thread_max_spinners
[561]   |    974032|       4|OBJT |LOCL |2    |18     |thread_queue_dump
[560]   |    974028|       4|OBJT |LOCL |2    |18     |thread_queue_fifo
[562]   |    969480|       4|OBJT |LOCL |2    |18     |thread_queue_spin
[501]   |    969476|       4|OBJT |LOCL |2    |18     |thread_queue_verify
[240]   |    969472|       4|OBJT |LOCL |2    |18     |thread_release_spin
[70]    |    974048|       4|OBJT |LOCL |2    |18     |thread_stack_cache
[oc@sol10 thread]$ nm /usr/lib/libc.so.1|grep thread|wc -l
     240

Solaris9のlibcのライブラリにあるスレッド系のシンボル
[oc@sol9 thread]$ nm /usr/lib/libc.so.1|grep thread
[3087]  |    631912|      36|FUNC |GLOB |0    |9      |__pthread_cleanup_pop
[3874]  |    631948|      36|FUNC |GLOB |0    |9      |__pthread_cleanup_push
[3920]  |    801204|       4|OBJT |GLOB |0    |23     |__threaded
[159]   |    353960|      44|FUNC |LOCL |0    |9      |_libc_pthread_cond_init
[103]   |    353644|      68|FUNC |LOCL |0    |9      |_libc_pthread_getspecific
[486]   |    353916|      44|FUNC |LOCL |0    |9      |_libc_pthread_mutex_init
[35]    |    354004|      44|FUNC |LOCL |0    |9      |_libc_pthread_rwlock_init
[2828]  |    627336|     216|FUNC |GLOB |0    |9      |_libc_threads_interface
[4334]  |    617372|      68|FUNC |GLOB |0    |9      |_lpthread_atfork
[3787]  |    617304|      68|FUNC |GLOB |0    |9      |_pthread_atfork
[4213]  |    631300|      36|FUNC |WEAK |0    |9      |_pthread_attr_destroy
[4503]  |    631336|      36|FUNC |WEAK |0    |9      |_pthread_attr_getdetachstate
[4078]  |    632600|      36|FUNC |WEAK |0    |9      |_pthread_attr_getguardsize
[4709]  |    631372|      36|FUNC |WEAK |0    |9      |_pthread_attr_getinheritsched
[4383]  |    631408|      36|FUNC |WEAK |0    |9      |_pthread_attr_getschedparam
[2886]  |    631444|      36|FUNC |WEAK |0    |9      |_pthread_attr_getschedpolicy
[3514]  |    631480|      36|FUNC |WEAK |0    |9      |_pthread_attr_getscope
[3971]  |    631516|      36|FUNC |WEAK |0    |9      |_pthread_attr_getstackaddr
[4938]  |    631552|      36|FUNC |WEAK |0    |9      |_pthread_attr_getstacksize
[4830]  |    631588|      36|FUNC |WEAK |0    |9      |_pthread_attr_init
[2959]  |    631624|      36|FUNC |WEAK |0    |9      |_pthread_attr_setdetachstate
[2998]  |    632636|      36|FUNC |WEAK |0    |9      |_pthread_attr_setguardsize
[3047]  |    631660|      36|FUNC |WEAK |0    |9      |_pthread_attr_setinheritsched
[3216]  |    631696|      36|FUNC |WEAK |0    |9      |_pthread_attr_setschedparam
[4434]  |    631732|      36|FUNC |WEAK |0    |9      |_pthread_attr_setschedpolicy
[4209]  |    631768|      36|FUNC |WEAK |0    |9      |_pthread_attr_setscope
[3459]  |    631804|      36|FUNC |WEAK |0    |9      |_pthread_attr_setstackaddr
[4442]  |    631840|      36|FUNC |WEAK |0    |9      |_pthread_attr_setstacksize
[3621]  |    631876|      36|FUNC |WEAK |0    |9      |_pthread_cancel
[3596]  |    629888|      36|FUNC |WEAK |0    |9      |_pthread_cond_broadcast
[4218]  |    629924|      36|FUNC |WEAK |0    |9      |_pthread_cond_destroy
[4895]  |    629960|      36|FUNC |WEAK |0    |9      |_pthread_cond_init
[3812]  |    630068|      36|FUNC |WEAK |0    |9      |_pthread_cond_reltimedwait_np
[4907]  |    629996|      36|FUNC |WEAK |0    |9      |_pthread_cond_signal
[4279]  |    630032|      36|FUNC |WEAK |0    |9      |_pthread_cond_timedwait
[3934]  |    630104|      36|FUNC |WEAK |0    |9      |_pthread_cond_wait
[3612]  |    630140|      36|FUNC |WEAK |0    |9      |_pthread_condattr_destroy
[5007]  |    630176|      36|FUNC |WEAK |0    |9      |_pthread_condattr_getpshared
[3533]  |    630212|      36|FUNC |WEAK |0    |9      |_pthread_condattr_init
[4684]  |    630248|      36|FUNC |WEAK |0    |9      |_pthread_condattr_setpshared
[4977]  |    631984|      36|FUNC |WEAK |0    |9      |_pthread_create
[2972]  |    632020|      36|FUNC |WEAK |0    |9      |_pthread_detach
[4872]  |    632056|      36|FUNC |WEAK |0    |9      |_pthread_equal
[4273]  |    632092|      36|FUNC |WEAK |0    |9      |_pthread_exit
[5011]  |    632672|      40|FUNC |WEAK |0    |9      |_pthread_getconcurrency
[3610]  |    632128|      36|FUNC |WEAK |0    |9      |_pthread_getschedparam
[4615]  |    632164|      36|FUNC |WEAK |0    |9      |_pthread_getspecific
[4278]  |    632200|      36|FUNC |WEAK |0    |9      |_pthread_join
[4021]  |    632236|      36|FUNC |WEAK |0    |9      |_pthread_key_create
[3657]  |    632272|      36|FUNC |WEAK |0    |9      |_pthread_key_delete
[4098]  |    632308|      36|FUNC |WEAK |0    |9      |_pthread_kill
[4190]  |    630284|      36|FUNC |WEAK |0    |9      |_pthread_mutex_destroy
[4195]  |    630320|      36|FUNC |WEAK |0    |9      |_pthread_mutex_getprioceiling
[2896]  |    630356|      36|FUNC |WEAK |0    |9      |_pthread_mutex_init
[2880]  |    630392|      36|FUNC |WEAK |0    |9      |_pthread_mutex_lock
[4368]  |    630428|      36|FUNC |WEAK |0    |9      |_pthread_mutex_setprioceiling
[2879]  |    630464|      36|FUNC |WEAK |0    |9      |_pthread_mutex_trylock
[3600]  |    630500|      36|FUNC |WEAK |0    |9      |_pthread_mutex_unlock
[3258]  |    630536|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_destroy
[4023]  |    630572|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_getprioceiling
[4147]  |    630608|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_getprotocol
[3004]  |    630644|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_getpshared
[3429]  |    632784|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_gettype
[5053]  |    630680|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_init
[3293]  |    630716|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_setprioceiling
[4510]  |    630752|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_setprotocol
[3318]  |    630788|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_setpshared
[4544]  |    632748|      36|FUNC |WEAK |0    |9      |_pthread_mutexattr_settype
[4000]  |    632344|      36|FUNC |WEAK |0    |9      |_pthread_once
[4413]  |    632856|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_destroy
[4983]  |    632820|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_init
[5054]  |    632892|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_rdlock
[3554]  |    632928|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_tryrdlock
[3423]  |    633000|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_trywrlock
[3870]  |    633036|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_unlock
[4925]  |    632964|      36|FUNC |WEAK |0    |9      |_pthread_rwlock_wrlock
[3758]  |    633108|      36|FUNC |WEAK |0    |9      |_pthread_rwlockattr_destroy
[2990]  |    633144|      36|FUNC |WEAK |0    |9      |_pthread_rwlockattr_getpshared
[4174]  |    633072|      36|FUNC |WEAK |0    |9      |_pthread_rwlockattr_init
[2888]  |    633180|      36|FUNC |WEAK |0    |9      |_pthread_rwlockattr_setpshared
[2860]  |    631224|      40|FUNC |WEAK |0    |9      |_pthread_self
[4143]  |    632380|      36|FUNC |WEAK |0    |9      |_pthread_setcancelstate
[5050]  |    632416|      36|FUNC |WEAK |0    |9      |_pthread_setcanceltype
[4307]  |    632712|      36|FUNC |WEAK |0    |9      |_pthread_setconcurrency
[4660]  |    632452|      36|FUNC |WEAK |0    |9      |_pthread_setschedparam
[2950]  |    632488|      36|FUNC |WEAK |0    |9      |_pthread_setspecific
[4792]  |    631264|      36|FUNC |WEAK |0    |9      |_pthread_sigmask
[3700]  |    632524|      40|FUNC |WEAK |0    |9      |_pthread_testcancel
[3156]  |    617304|      68|FUNC |WEAK |0    |9      |pthread_atfork
[3534]  |    631300|      36|FUNC |WEAK |0    |9      |pthread_attr_destroy
[4585]  |    631336|      36|FUNC |WEAK |0    |9      |pthread_attr_getdetachstate
[3199]  |    632600|      36|FUNC |WEAK |0    |9      |pthread_attr_getguardsize
[3551]  |    631372|      36|FUNC |WEAK |0    |9      |pthread_attr_getinheritsched
[3256]  |    631408|      36|FUNC |WEAK |0    |9      |pthread_attr_getschedparam
[4158]  |    631444|      36|FUNC |WEAK |0    |9      |pthread_attr_getschedpolicy
[3676]  |    631480|      36|FUNC |WEAK |0    |9      |pthread_attr_getscope
[4701]  |    631516|      36|FUNC |WEAK |0    |9      |pthread_attr_getstackaddr
[4260]  |    631552|      36|FUNC |WEAK |0    |9      |pthread_attr_getstacksize
[4354]  |    631588|      36|FUNC |WEAK |0    |9      |pthread_attr_init
[3042]  |    631624|      36|FUNC |WEAK |0    |9      |pthread_attr_setdetachstate
[4382]  |    632636|      36|FUNC |WEAK |0    |9      |pthread_attr_setguardsize
[4131]  |    631660|      36|FUNC |WEAK |0    |9      |pthread_attr_setinheritsched
[4332]  |    631696|      36|FUNC |WEAK |0    |9      |pthread_attr_setschedparam
[3449]  |    631732|      36|FUNC |WEAK |0    |9      |pthread_attr_setschedpolicy
[4333]  |    631768|      36|FUNC |WEAK |0    |9      |pthread_attr_setscope
[4234]  |    631804|      36|FUNC |WEAK |0    |9      |pthread_attr_setstackaddr
[3789]  |    631840|      36|FUNC |WEAK |0    |9      |pthread_attr_setstacksize
[3499]  |    631876|      36|FUNC |WEAK |0    |9      |pthread_cancel
[3693]  |    629888|      36|FUNC |WEAK |0    |9      |pthread_cond_broadcast
[3623]  |    629924|      36|FUNC |WEAK |0    |9      |pthread_cond_destroy
[3279]  |    629960|      36|FUNC |WEAK |0    |9      |pthread_cond_init
[3849]  |    630068|      36|FUNC |WEAK |0    |9      |pthread_cond_reltimedwait_np
[4375]  |    629996|      36|FUNC |WEAK |0    |9      |pthread_cond_signal
[4632]  |    630032|      36|FUNC |WEAK |0    |9      |pthread_cond_timedwait
[4529]  |    630104|      36|FUNC |WEAK |0    |9      |pthread_cond_wait
[4447]  |    630140|      36|FUNC |WEAK |0    |9      |pthread_condattr_destroy
[4175]  |    630176|      36|FUNC |WEAK |0    |9      |pthread_condattr_getpshared
[3502]  |    630212|      36|FUNC |WEAK |0    |9      |pthread_condattr_init
[3027]  |    630248|      36|FUNC |WEAK |0    |9      |pthread_condattr_setpshared
[2841]  |    631984|      36|FUNC |WEAK |0    |9      |pthread_create
[3625]  |    632020|      36|FUNC |WEAK |0    |9      |pthread_detach
[3362]  |    632056|      36|FUNC |WEAK |0    |9      |pthread_equal
[2843]  |    632092|      36|FUNC |WEAK |0    |9      |pthread_exit
[4277]  |    632672|      40|FUNC |WEAK |0    |9      |pthread_getconcurrency
[4177]  |    632128|      36|FUNC |WEAK |0    |9      |pthread_getschedparam
[2913]  |    632164|      36|FUNC |WEAK |0    |9      |pthread_getspecific
[2904]  |    632200|      36|FUNC |WEAK |0    |9      |pthread_join
[4254]  |    632236|      36|FUNC |WEAK |0    |9      |pthread_key_create
[3906]  |    632272|      36|FUNC |WEAK |0    |9      |pthread_key_delete
[4838]  |    632308|      36|FUNC |WEAK |0    |9      |pthread_kill
[4167]  |    630284|      36|FUNC |WEAK |0    |9      |pthread_mutex_destroy
[3884]  |    630320|      36|FUNC |WEAK |0    |9      |pthread_mutex_getprioceiling
[3685]  |    630356|      36|FUNC |WEAK |0    |9      |pthread_mutex_init
[3678]  |    630392|      36|FUNC |WEAK |0    |9      |pthread_mutex_lock
[4062]  |    630428|      36|FUNC |WEAK |0    |9      |pthread_mutex_setprioceiling
[4854]  |    630464|      36|FUNC |WEAK |0    |9      |pthread_mutex_trylock
[3715]  |    630500|      36|FUNC |WEAK |0    |9      |pthread_mutex_unlock
[4803]  |    630536|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_destroy
[4603]  |    630572|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_getprioceiling
[4775]  |    630608|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_getprotocol
[3338]  |    630644|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_getpshared
[4957]  |    632784|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_gettype
[3967]  |    630680|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_init
[3203]  |    630716|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_setprioceiling
[4992]  |    630752|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_setprotocol
[4067]  |    630788|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_setpshared
[3837]  |    632748|      36|FUNC |WEAK |0    |9      |pthread_mutexattr_settype
[4778]  |    632344|      36|FUNC |WEAK |0    |9      |pthread_once
[4515]  |    632856|      36|FUNC |WEAK |0    |9      |pthread_rwlock_destroy
[4868]  |    632820|      36|FUNC |WEAK |0    |9      |pthread_rwlock_init
[3206]  |    632892|      36|FUNC |WEAK |0    |9      |pthread_rwlock_rdlock
[4850]  |    632928|      36|FUNC |WEAK |0    |9      |pthread_rwlock_tryrdlock
[4719]  |    633000|      36|FUNC |WEAK |0    |9      |pthread_rwlock_trywrlock
[4832]  |    633036|      36|FUNC |WEAK |0    |9      |pthread_rwlock_unlock
[4497]  |    632964|      36|FUNC |WEAK |0    |9      |pthread_rwlock_wrlock
[3428]  |    633108|      36|FUNC |WEAK |0    |9      |pthread_rwlockattr_destroy
[4435]  |    633144|      36|FUNC |WEAK |0    |9      |pthread_rwlockattr_getpshared
[4630]  |    633072|      36|FUNC |WEAK |0    |9      |pthread_rwlockattr_init
[4339]  |    633180|      36|FUNC |WEAK |0    |9      |pthread_rwlockattr_setpshared
[3643]  |    631224|      40|FUNC |WEAK |0    |9      |pthread_self
[3769]  |    632380|      36|FUNC |WEAK |0    |9      |pthread_setcancelstate
[3679]  |    632416|      36|FUNC |WEAK |0    |9      |pthread_setcanceltype
[3605]  |    632712|      36|FUNC |WEAK |0    |9      |pthread_setconcurrency
[3012]  |    632452|      36|FUNC |WEAK |0    |9      |pthread_setschedparam
[3488]  |    632488|      36|FUNC |WEAK |0    |9      |pthread_setspecific
[3128]  |    631264|      36|FUNC |WEAK |0    |9      |pthread_sigmask
[4460]  |    632524|      40|FUNC |WEAK |0    |9      |pthread_testcancel
[oc@sol9 thread]$ nm /usr/lib/libc.so.1|grep thread|wc -l
     167

シンボルは意味ない比較だったな。