Skip to content

Commit

Permalink
land/newlib: Add missing stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
lutoma committed Dec 7, 2023
1 parent ed0bfa3 commit 2bff539
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions land/newlib/xelix/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <mntent.h>
#include <pthread.h>
#include <syslog.h>
#include <sched.h>

#ifdef NOISY_STUBS
#define STUBWARN(cmd) fprintf(stderr, "xelix-newlib: " #cmd " stub called.\n");
Expand Down Expand Up @@ -144,3 +145,8 @@ STUB(int, sigblock, (int mask), -1);
STUB(int, sigsetmask, (int mask), -1);
STUB(int, siggetmask, (void), -1);
STUB(int, symlink, (const char *path1, const char *path2), -1);
STUB(int, sched_setscheduler, (pid_t pid, int policy, const struct sched_param *param), -1);
STUB(int, sched_setparam, (pid_t pid, const struct sched_param *param), -1);
STUB(int, posix_memalign, (void **memptr, size_t alignment, size_t size), EINVAL);
STUB(int, getentropy, (void* buffer, size_t length), -1);
STUB(int, execvpe, (const char *file, char *const argv[], char *const envp[]), -1);
4 changes: 2 additions & 2 deletions land/newlib/xelix/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@ int lstat(const char* name, struct stat *st) {
return stat(name, st);
}

int mkdir(const char *dir_path, mode_t mode) {
return syscall(6, dir_path, mode, 0);
int _mkdir(const char *dir_path, mode_t mode) {
return syscall_pf(6, dir_path, mode, 0);
}

int _unlink(char *name) {
Expand Down

0 comments on commit 2bff539

Please sign in to comment.