summaryrefslogtreecommitdiff
path: root/nonstd/static/fopen.h
diff options
context:
space:
mode:
Diffstat (limited to 'nonstd/static/fopen.h')
-rw-r--r--nonstd/static/fopen.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nonstd/static/fopen.h b/nonstd/static/fopen.h
new file mode 100644
index 00000000..64d30f1e
--- /dev/null
+++ b/nonstd/static/fopen.h
@@ -0,0 +1,12 @@
+#include "nonstd/FILE.h"
+
+static FILE *__common_fopen(struct __fopen_options *opt)
+{
+ FILE *f = NULL;
+ if (__libc.stdio.nopen < FOPEN_MAX) {
+ f = __libc.stdio.files + __libc.stdio.nopen;
+ __libc.stdio.nopen++;
+ }
+ f->fd = opt->fd;
+ return f;
+}