Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions newlib/libc/sys/hermit/fcntl.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <sys/stat.h>

int sys_fcntl(int fildes, int cmd, int arg);
__attribute__((weak)) int sys_fcntl(int fildes, int cmd, int arg) {
fprintf(stderr, "weak sys_fcntl() called. Symbol was not replaced!\n");
errno = ENOSYS;
return -1;
}

int fcntl(int fildes, int cmd, ...) {
int arg = 0;
Expand All @@ -28,7 +33,11 @@ int fcntl(int fildes, int cmd, ...) {
return ret;
}

int sys_open(const char *path, int oflag, mode_t mode);
__attribute__((weak)) int sys_open(const char *path, int oflag, mode_t mode) {
fprintf(stderr, "weak sys_open() called. Symbol was not replaced!\n");
errno = ENOSYS;
return -1;
}

int open(const char *path, int oflag, ...) {
mode_t mode = 0;
Expand Down
4 changes: 3 additions & 1 deletion newlib/libc/sys/hermit/forward-in.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <fcntl.h>
#include <time.h>
#include <unistd.h>

Expand Down
Loading