Skip to content

Commit

Permalink
fix: stub getentropy and mkdir
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob committed Aug 20, 2024
1 parent a6eb320 commit 5a71662
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions newlib/libc/sys/hermit/crt0.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <reent.h>
#include "syscall.h"


extern int main(int argc, char** argv);
extern void __libc_init_array(void);
extern void __libc_fini_array (void);
Expand Down Expand Up @@ -86,6 +87,12 @@ void _free_r(struct _reent* r, void* ptr) {
}
}

int getentropy(void *ptr, __size_t n) { return -1; };

int32_t mkdir(const char *name, uint32_t mode) {
return sys_mkdir(name, mode);
}

void runtime_entry(int argc, char** argv, char** env)
{
int ret;
Expand Down
2 changes: 2 additions & 0 deletions newlib/libc/sys/hermit/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ int swapcontext(ucontext_t *oucp, const ucontext_t *ucp);
int getcontext(ucontext_t *ucp);
int setcontext(ucontext_t *ucp);

int32_t sys_mkdir(const char *name, uint32_t mode);

#define __NR_exit 0
#define __NR_write 1
#define __NR_open 2
Expand Down

0 comments on commit 5a71662

Please sign in to comment.