summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorGunnar Beutner <gunnar@beutner.name>2021-04-11 19:00:36 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-14 21:46:20 +0200
commit546fa8cfb52b97f479002e6e2b5327c2e0b45297 (patch)
tree45d412b06d215930544105d845f7c535287573fa /Userland
parent6a808d96b5e9948cfc9f09a368fb0c1f6c351c94 (diff)
downloadserenity-546fa8cfb52b97f479002e6e2b5327c2e0b45297.zip
LibC: Change return type for sleep() to unsigned int
According to POSIX.1-2001 the return type should be unsigned int.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibC/unistd.cpp2
-rw-r--r--Userland/Libraries/LibC/unistd.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibC/unistd.cpp b/Userland/Libraries/LibC/unistd.cpp
index 8fd1acb93e..5d0fe6db68 100644
--- a/Userland/Libraries/LibC/unistd.cpp
+++ b/Userland/Libraries/LibC/unistd.cpp
@@ -409,7 +409,7 @@ char* getwd(char* buf)
return p;
}
-int sleep(unsigned seconds)
+unsigned int sleep(unsigned int seconds)
{
struct timespec ts = { seconds, 0 };
if (clock_nanosleep(CLOCK_MONOTONIC_COARSE, 0, &ts, nullptr) < 0)
diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h
index aca2197301..54dd27a891 100644
--- a/Userland/Libraries/LibC/unistd.h
+++ b/Userland/Libraries/LibC/unistd.h
@@ -106,7 +106,7 @@ int chdir(const char* path);
int fchdir(int fd);
char* getcwd(char* buffer, size_t size);
char* getwd(char* buffer);
-int sleep(unsigned seconds);
+unsigned int sleep(unsigned int seconds);
int usleep(useconds_t);
int gethostname(char*, size_t);
int sethostname(const char*, ssize_t);