diff --git a/src/select/poll.c b/src/select/poll.c index f1e73e8..b2f8b00 100644 --- a/src/select/poll.c +++ b/src/select/poll.c @@ -6,3 +6,5 @@ int poll(struct pollfd *fds, nfds_t n, int timeout) { return syscall_cp(SYS_poll, fds, n, timeout); } + +weak_alias(poll, __poll); diff --git a/src/stdio/fscanf.c b/src/stdio/fscanf.c index 51fc9b3..155f8ac 100644 --- a/src/stdio/fscanf.c +++ b/src/stdio/fscanf.c @@ -1,5 +1,6 @@ #include #include +#include "libc.h" int fscanf(FILE *f, const char *fmt, ...) { @@ -10,3 +11,5 @@ int fscanf(FILE *f, const char *fmt, ...) va_end(ap); return ret; } + +weak_alias(fscanf, __isoc99_fscanf); diff --git a/src/stdio/sscanf.c b/src/stdio/sscanf.c index a1cea69..8c16343 100644 --- a/src/stdio/sscanf.c +++ b/src/stdio/sscanf.c @@ -1,5 +1,6 @@ #include #include +#include "libc.h" int sscanf(const char *s, const char *fmt, ...) { @@ -10,3 +11,5 @@ int sscanf(const char *s, const char *fmt, ...) va_end(ap); return ret; } + +weak_alias(sscanf, __isoc99_sscanf); diff --git a/src/string/strndup.c b/src/string/strndup.c index 617d27b..b162d8b 100644 --- a/src/string/strndup.c +++ b/src/string/strndup.c @@ -1,7 +1,8 @@ #include #include +#include "libc.h" -char *strndup(const char *s, size_t n) +char *__strndup(const char *s, size_t n) { size_t l = strnlen(s, n); char *d = malloc(l+1); @@ -10,3 +11,5 @@ char *strndup(const char *s, size_t n) d[l] = 0; return d; } + +weak_alias(__strndup, strndup);