Commit 7af8bdd5 authored by Jeremy Soller's avatar Jeremy Soller

Add stubs for pthread_condattr_{get,set}clock

parent b08f3c5c
......@@ -251,6 +251,8 @@ struct pthread_cond_t_
struct pthread_condattr_t_
{
int pshared;
// TODO: use clock_id
clockid_t clock_id;
};
#define PTE_RWLOCK_MAGIC 0xfacade2
......
......@@ -846,6 +846,12 @@ extern "C" {
int pthread_condattr_setpshared (pthread_condattr_t * attr,
int pshared);
int pthread_condattr_getclock (const pthread_condattr_t * attr,
clockid_t *clock_id);
int pthread_condattr_setclock (pthread_condattr_t * attr,
clockid_t clock_id);
/*
* Condition Variable Functions
*/
......
#include "pthread.h"
#include "implement.h"
int
pthread_condattr_getclock (const pthread_condattr_t * attr, clockid_t *clock_id)
{
int result;
if ((attr != NULL && *attr != NULL) && (clock_id != NULL))
{
*clock_id = (*attr)->clock_id;
result = 0;
}
else
{
result = EINVAL;
}
return result;
}
#include "pthread.h"
#include "implement.h"
int
pthread_condattr_setclock (pthread_condattr_t * attr, clockid_t clock_id)
{
int result;
if ((attr != NULL && *attr != NULL)
&& ((clock_id == CLOCK_REALTIME)
|| (clock_id == CLOCK_MONOTONIC)))
{
(*attr)->clock_id = clock_id;
result = 0;
}
else
{
result = EINVAL;
}
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment