***: add various stub functions for binutils

This commit is contained in:
Mark
2020-08-24 11:37:36 +03:00
parent c098d5ec60
commit f7c99dfcbe
7 changed files with 45 additions and 3 deletions
+2
View File
@@ -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, ...);
+2
View File
@@ -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);
+9
View File
@@ -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");
}
+7
View File
@@ -0,0 +1,7 @@
#include <stdlib.h>
double atof(const char *str) {
(void) str;
// TODO
return 0.0;
}
+9
View File
@@ -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");
}
+7
View File
@@ -0,0 +1,7 @@
#include <sys/stat.h>
#include <assert.h>
mode_t umask(mode_t cmask) {
(void) cmask;
assert(0 && "Not implemented yet");
}
+9 -3
View File
@@ -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();
}
}