LibC: Implement usleep()

This is not a POSIX function, but some ports seem to be using it either
way
This commit is contained in:
2024-08-05 00:54:17 +03:00
parent 3651306f57
commit e7a06979ec
3 changed files with 16 additions and 0 deletions

View File

@@ -280,6 +280,14 @@ unsigned int sleep(unsigned int seconds)
return ret;
}
int usleep(useconds_t usec)
{
timespec ts;
ts.tv_sec = usec / 1'000'000;
ts.tv_nsec = (usec % 1'000'000) * 1000;
return nanosleep(&ts, nullptr);
}
char* getcwd(char* buf, size_t size)
{
if (size == 0)