LibC: Change return type for sleep() to unsigned int

According to POSIX.1-2001 the return type should be unsigned int.
This commit is contained in:
Gunnar Beutner 2021-04-11 19:00:36 +02:00 committed by Andreas Kling
parent 6a808d96b5
commit 546fa8cfb5
Notes: sideshowbarker 2024-07-18 20:21:46 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -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);