From c9ec058657f9f8b3fd39a16f1a9e993b4a1e982e Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 28 May 2024 15:50:03 -0400 Subject: abstract out "forced" implementations of functions from future specifications --- src/stdio/remove.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'src/stdio/remove.c') diff --git a/src/stdio/remove.c b/src/stdio/remove.c index 8b6c5925..e52132de 100644 --- a/src/stdio/remove.c +++ b/src/stdio/remove.c @@ -1,42 +1,22 @@ -#ifndef _POSIX_SOURCE -#define _POSIX_SOURCE -#define POSIX_FORCED -#endif - #include #include "_stdio.h" - -#if 0 -#include -#include -#include -#endif - -#ifdef POSIX_FORCED -#include "_syscall.h" -#define stat(_f, _b) __scall2(stat, _f, _b) -#define rmdir(_f) __scall1(rmdir, _f) -#define unlink(_f) __scall1(unlink, _f) -#endif +#include "_forced/stat.h" +#include "_forced/rmdir.h" +#include "_forced/unlink.h" /** delete a file **/ int remove(const char *filename) { - /* struct stat st; */ + struct stat st; SIGNAL_SAFE(0); - /* stat(filename, &st); if (S_ISDIR(st.st_mode)) { return rmdir(filename); } return unlink(filename); - */ - - (void)filename; - return -1; } /*** -- cgit v1.2.1