LibC: Add stubs for tmpfile, mktemp and fchmod

This commit is contained in:
Bananymous 2024-08-09 17:02:20 +03:00
parent 2797fe116f
commit 6cda639869
4 changed files with 18 additions and 0 deletions

View File

@ -73,6 +73,7 @@ int mblen(const char* s, size_t n);
size_t mbstowcs(wchar_t* __restrict pwcs, const char* __restrict s, size_t n);
int mbtowc(wchar_t* __restrict pwc, const char* __restrict s, size_t n);
char* mkdtemp(char* _template);
char* mktemp(char* _template);
int mkstemp(char* _template);
long mrand48(void);
long nrand48(unsigned short xsubi[3]);

View File

@ -840,3 +840,8 @@ int vsscanf(const char* s, const char* format, va_list arguments)
}, &s
);
}
FILE* tmpfile(void)
{
ASSERT_NOT_REACHED();
}

View File

@ -514,6 +514,11 @@ int putenv(char* string)
return 0;
}
char* mktemp(char*)
{
ASSERT_NOT_REACHED();
}
size_t mbstowcs(wchar_t* __restrict pwcs, const char* __restrict s, size_t n)
{
auto* us = reinterpret_cast<const unsigned char*>(s);

View File

@ -1,3 +1,5 @@
#include <BAN/Assert.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
@ -11,6 +13,11 @@ int chmod(const char* path, mode_t mode)
return syscall(SYS_CHMOD, path, mode);
}
int fchmod(int, mode_t)
{
ASSERT_NOT_REACHED();
}
int fstat(int fildes, struct stat* buf)
{
return syscall(SYS_FSTAT, fildes, buf);