Skip to content

Commit

Permalink
fix: stub some more functions
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob committed Aug 20, 2024
1 parent 5a71662 commit 6341c70
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 4 deletions.
50 changes: 50 additions & 0 deletions newlib/libc/sys/hermit/crt0.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <unistd.h>
#include <getopt.h>
#include <reent.h>
#include <dirent.h>
#include "syscall.h"


Expand Down Expand Up @@ -93,6 +94,55 @@ int32_t mkdir(const char *name, uint32_t mode) {
return sys_mkdir(name, mode);
}

int chdir(const char *path) {
return -1;
}

int fchdir(int fd) {
return -1;
}

int chmod(const char *path, mode_t mode) {
return -1;
}

int fchmod(int fd, mode_t mode) {
return -1;
}

int chown(const char *path, uid_t owner, gid_t group) {
return -1;
}

int fchown(int fd, uid_t owner, gid_t group) {
return -1;
}

int truncate(const char *path, off_t length) {
return -1;
}
int ftruncate(int fd, off_t length) {
return -1;
}

long fpathconf (int fd, int name) {
return -1;
}

long pathconf (const char *path, int name) {
return -1;
}

char *getcwd (char *__buf, size_t __size) {
return NULL;
}

int getdents(int fd, void *dp, int count) { return -1; }

int _rename_r (struct _reent *r, const char *a, const char *b) { return -1; }



void runtime_entry(int argc, char** argv, char** env)
{
int ret;
Expand Down
2 changes: 0 additions & 2 deletions newlib/libc/sys/hermit/readlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@
#include <sys/types.h>
#include "warning.h"

#if 0
int
readlink (const char* path, char* buf, size_t bufsize)
{
return _readlink_r(_REENT, path, buf, bufsize);
}
#endif

int
_readlink_r (struct _reent* ptr, const char* path, char* buf, size_t bufsize)
Expand Down
2 changes: 0 additions & 2 deletions newlib/libc/sys/hermit/symlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@
#include <errno.h>
#include "warning.h"

#if 0
int
symlink (const char* path1, const char* path2)
{
return _symlink_r(_REENT, path1, path2);
}
#endif

int
_symlink_r (struct _reent* ptr, const char* path1, const char* path2)
Expand Down

0 comments on commit 6341c70

Please sign in to comment.