|
From: falcovorbis <fal...@us...> - 2024-04-21 17:50:16
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 5ae615b8c20b78cab7485856a6d8f541c331c089 (commit)
from 2b9d90b825ad834bf53f39fd58651174076fe922 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5ae615b8c20b78cab7485856a6d8f541c331c089
Author: Paul Cercueil <pa...@cr...>
Date: Sun Apr 21 19:50:00 2024 +0200
fs: Remove duplicated fcntl() function (#511)
Newlib already provides fcntl(), which will end up calling _fcntl_r()
provided by KOS. This previously did not cause problems as the linker
would pick the first symbol found (which means the link order mattered).
Rust however will complain that the symbol is duplicated. Address this
by removing the KOS' fcntl(), which should not have any side effects.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
kernel/fs/fs.c | 2 +-
kernel/libc/newlib/newlib_fcntl.c | 16 ++--------------
2 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c
index e027af1b..1f0e310b 100644
--- a/kernel/fs/fs.c
+++ b/kernel/fs/fs.c
@@ -696,7 +696,7 @@ int fs_rmdir(const char * fn) {
}
}
-int fs_vfcntl(file_t fd, int cmd, va_list ap) {
+static int fs_vfcntl(file_t fd, int cmd, va_list ap) {
fs_hnd_t *h = fs_map_hnd(fd);
int rv;
diff --git a/kernel/libc/newlib/newlib_fcntl.c b/kernel/libc/newlib/newlib_fcntl.c
index 1379020a..eab54cba 100644
--- a/kernel/libc/newlib/newlib_fcntl.c
+++ b/kernel/libc/newlib/newlib_fcntl.c
@@ -5,25 +5,13 @@
*/
-#include <sys/reent.h>
#include <sys/fcntl.h>
-#include <stdarg.h>
#include <kos/fs.h>
+struct _reent;
+
int _fcntl_r(struct _reent *reent, int fd, int cmd, int arg) {
(void)reent;
return fs_fcntl(fd, cmd, arg);
}
-
-extern int fs_vfcntl(file_t fd, int cmd, va_list ap);
-
-int fcntl(int fd, int cmd, ...) {
- va_list ap;
- int rv;
-
- va_start(ap, cmd);
- rv = fs_vfcntl(fd, cmd, ap);
- va_end(ap);
- return rv;
-}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|