1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:27:45 +00:00

Kernel+LibC+UE: Implement usleep() via sys$clock_nanosleep()

This doesn't need to be its own syscall. Thanks @BenWiederhake for
the idea. :^)
This commit is contained in:
Andreas Kling 2020-08-30 10:43:15 +02:00
parent 95ed363b15
commit f857f3ce4c
5 changed files with 4 additions and 22 deletions

View file

@ -117,7 +117,6 @@ namespace Kernel {
S(poll) \
S(rmdir) \
S(chmod) \
S(usleep) \
S(socket) \
S(bind) \
S(accept) \
@ -241,7 +240,7 @@ struct ImmutableBufferArgument {
};
struct StringListArgument {
Userspace<StringArgument*> strings { };
Userspace<StringArgument*> strings {};
size_t length { 0 };
};

View file

@ -29,17 +29,6 @@
namespace Kernel {
int Process::sys$usleep(useconds_t usec)
{
REQUIRE_PROMISE(stdio);
if (!usec)
return 0;
u64 wakeup_time = Thread::current()->sleep(usec * TimeManagement::the().ticks_per_second() / 1000000);
if (wakeup_time > g_uptime)
return -EINTR;
return 0;
}
int Process::sys$sleep(unsigned seconds)
{
REQUIRE_PROMISE(stdio);