mirror of https://github.com/RT-Thread/rt-thread
[cputime] add sys/errno.h
This commit is contained in:
parent
740a810274
commit
ae0e0bdad4
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include <rtdevice.h>
|
#include <rtdevice.h>
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
#include <sys/errno.h>
|
||||||
|
|
||||||
static const struct rt_clock_cputime_ops *_cputime_ops = RT_NULL;
|
static const struct rt_clock_cputime_ops *_cputime_ops = RT_NULL;
|
||||||
|
|
||||||
|
@ -24,7 +25,7 @@ float clock_cpu_getres(void)
|
||||||
if (_cputime_ops)
|
if (_cputime_ops)
|
||||||
return _cputime_ops->cputime_getres();
|
return _cputime_ops->cputime_getres();
|
||||||
|
|
||||||
rt_set_errno(-ENOSYS);
|
rt_set_errno(ENOSYS);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ uint32_t clock_cpu_gettime(void)
|
||||||
if (_cputime_ops)
|
if (_cputime_ops)
|
||||||
return _cputime_ops->cputime_gettime();
|
return _cputime_ops->cputime_gettime();
|
||||||
|
|
||||||
rt_set_errno(-ENOSYS);
|
rt_set_errno(ENOSYS);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue