summaryrefslogtreecommitdiff
path: root/src/stdio/freopen.c
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-05-28 15:50:03 -0400
committerJakob Kaivo <jkk@ung.org>2024-05-28 15:50:03 -0400
commitc9ec058657f9f8b3fd39a16f1a9e993b4a1e982e (patch)
tree6cf1abadd04a1a9049d82ffe0e78be7f8b4cece2 /src/stdio/freopen.c
parentb4cd7036bea6c6440fbbcdaebe53c864c87a5646 (diff)
abstract out "forced" implementations of functions from future specifications
Diffstat (limited to 'src/stdio/freopen.c')
-rw-r--r--src/stdio/freopen.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/stdio/freopen.c b/src/stdio/freopen.c
index f23d53af..60394ca6 100644
--- a/src/stdio/freopen.c
+++ b/src/stdio/freopen.c
@@ -1,25 +1,9 @@
-#ifndef _POSIX_SOURCE
-#define _POSIX_SOURCE
-#define POSIX_FORCED
-#endif
-
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "_stdio.h"
-
-#ifdef POSIX_FORCED
-#include "_syscall.h"
-#define open(_p, _f, _m) __scall3(open, _p, _f, _m)
-#define isatty(_fd) (-1) /*ioctl(_fd, TCFLSH, 0) */
-#define TCFLSH 0x540B
-#define O_RDONLY 00
-#define O_WRONLY 01
-#define O_CREAT 0100
-#define O_TRUNC 01000
-#define O_APPEND 02000
-#define O_RDWR 02
-#endif
+#include "_forced/open.h"
+#include "_forced/isatty.h"
/** reopen a file stream with a new file **/