***: add various stub functions for binutils
This commit is contained in:
@@ -4,3 +4,5 @@
|
||||
|
||||
int open(const char *pathname, int flags, ...);
|
||||
int openat(int dfd, const char *pathname, int flags, mode_t mode);
|
||||
|
||||
int fcntl(int fd, int cmd, ...);
|
||||
|
||||
@@ -8,6 +8,8 @@ int lstat(const char *restrict path, struct stat *restrict buf);
|
||||
int fstat(int fd, struct stat *st);
|
||||
int fstatat(int dfd, const char *restrict path, struct stat *restrict buf, int flags);
|
||||
|
||||
mode_t umask(mode_t cmask);
|
||||
|
||||
int mkdir(const char *path, mode_t mode);
|
||||
int mkdirat(int fd, const char *path, mode_t mode);
|
||||
int chmod(const char *pathname, mode_t mode);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
int fcntl(int fd, int cmd, ...) {
|
||||
return 0;
|
||||
(void) fd;
|
||||
(void) cmd;
|
||||
assert(0 && "Not implemented yet");
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
double atof(const char *str) {
|
||||
(void) str;
|
||||
// TODO
|
||||
return 0.0;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
size_t mbstowcs(wchar_t *dest, const char *src, size_t n) {
|
||||
(void) dest;
|
||||
(void) src;
|
||||
(void) n;
|
||||
assert(0 && "Not implemented yet\n");
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <assert.h>
|
||||
|
||||
mode_t umask(mode_t cmask) {
|
||||
(void) cmask;
|
||||
assert(0 && "Not implemented yet");
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
long sysconf(int name) {
|
||||
(void) name;
|
||||
assert(0 && "Not implemented");
|
||||
switch (name) {
|
||||
case _SC_OPEN_MAX:
|
||||
return 16;
|
||||
default:
|
||||
fprintf(stderr, "Unknown sysconf(): %d\n", name);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user