pthread_condattr_setclock.c 390 B

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