Skip to content

Commit

Permalink
Merge pull request #956 from Dennisbonke/nanosleep
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke authored Dec 18, 2023
2 parents abd16bb + f0fb2aa commit 5ea2031
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions options/ansi/generic/time-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,10 @@ int clock_gettime(clockid_t clock, struct timespec *time) {
return 0;
}

int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *) {
__ensure(!"clock_nanosleep() not implemented");
__builtin_unreachable();
int clock_nanosleep(clockid_t clockid, int, const struct timespec *req, struct timespec *) {
mlibc::infoLogger() << "clock_nanosleep is implemented as nanosleep!" << frg::endlog;
__ensure(clockid == CLOCK_REALTIME || clockid == CLOCK_MONOTONIC);
return nanosleep(req, nullptr);
}

int clock_settime(clockid_t, const struct timespec *) {
Expand Down
4 changes: 4 additions & 0 deletions options/posix/generic/posix_stdlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ int mkostemps(char *pattern, int suffixlen, int flags) {
return mkostemp(pattern, flags);
}

int mkstemps(char *pattern, int suffixlen) {
return mkostemps(pattern, suffixlen, 0);
}

char *mkdtemp(char *pattern) {
mlibc::infoLogger() << "mlibc mkdtemp(" << pattern << ") called" << frg::endlog;
auto n = strlen(pattern);
Expand Down
1 change: 1 addition & 0 deletions options/posix/include/bits/posix/posix_stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ int unsetenv(const char *);
// ----------------------------------------------------------------------------

int mkstemp(char *);
int mkstemps(char *pattern, int suffixlen);
int mkostemp(char *, int flags);
int mkostemps(char *pattern, int suffixlen, int flags);
char *mkdtemp(char *path);
Expand Down

0 comments on commit 5ea2031

Please sign in to comment.