LibC: Add dummy functions for rename() and strftime()

I don't really want to implement them right now, but they are required
to exist for some ports.
This commit is contained in:
2024-06-17 21:00:50 +03:00
parent be7ed8e74a
commit 5236e1ef0d
3 changed files with 19 additions and 9 deletions

View File

@@ -1,3 +1,6 @@
#include <BAN/Assert.h>
#include <BAN/Debug.h>
#include <bits/printf.h>
#include <errno.h>
#include <fcntl.h>
@@ -603,7 +606,11 @@ int remove(const char* path)
}
// TODO
int rename(const char*, const char*);
int rename(const char* old, const char* _new)
{
dwarnln("rename({}, {})", old, _new);
ASSERT_NOT_REACHED();
}
void rewind(FILE* file)
{

View File

@@ -1,3 +1,6 @@
#include <BAN/Assert.h>
#include <BAN/Debug.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
@@ -75,3 +78,9 @@ struct tm* localtime(const time_t* timer)
// FIXME: support timezones
return gmtime(timer);
}
size_t strftime(char* __restrict s, size_t maxsize, const char* __restrict format, const struct tm* __restrict timeptr)
{
dwarnln("strftime({}, {}, {}, {})", s, maxsize, format, timeptr);
ASSERT_NOT_REACHED();
}