1*7af8bdd5SJeremy Soller #include "pthread.h" 2*7af8bdd5SJeremy Soller #include "implement.h" 3*7af8bdd5SJeremy Soller 4*7af8bdd5SJeremy Soller int pthread_condattr_setclock(pthread_condattr_t * attr,clockid_t clock_id)5*7af8bdd5SJeremy Sollerpthread_condattr_setclock (pthread_condattr_t * attr, clockid_t clock_id) 6*7af8bdd5SJeremy Soller { 7*7af8bdd5SJeremy Soller int result; 8*7af8bdd5SJeremy Soller 9*7af8bdd5SJeremy Soller if ((attr != NULL && *attr != NULL) 10*7af8bdd5SJeremy Soller && ((clock_id == CLOCK_REALTIME) 11*7af8bdd5SJeremy Soller || (clock_id == CLOCK_MONOTONIC))) 12*7af8bdd5SJeremy Soller { 13*7af8bdd5SJeremy Soller (*attr)->clock_id = clock_id; 14*7af8bdd5SJeremy Soller result = 0; 15*7af8bdd5SJeremy Soller } 16*7af8bdd5SJeremy Soller else 17*7af8bdd5SJeremy Soller { 18*7af8bdd5SJeremy Soller result = EINVAL; 19*7af8bdd5SJeremy Soller } 20*7af8bdd5SJeremy Soller 21*7af8bdd5SJeremy Soller return result; 22*7af8bdd5SJeremy Soller } 23