123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include "time.h"
- #include "errno.h"
- #include "unistd.h"
- #include <libsystem/syscall.h>
- int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
- {
- return syscall_invoke(SYS_NANOSLEEP, (uint64_t)rqtp, (uint64_t)rmtp, 0, 0, 0, 0, 0, 0);
- }
- int usleep(useconds_t usec)
- {
- struct timespec ts = {
- tv_sec : (long int)(usec / 1000000),
- tv_nsec : (long int)(usec % 1000000) * 1000UL
- };
- return nanosleep(&ts, NULL);
- }
- clock_t clock()
- {
- return (clock_t)syscall_invoke(SYS_CLOCK, 0,0,0,0,0,0,0,0);
- }
|