summaryrefslogtreecommitdiff
path: root/sysdep/unix/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/unix/io.c')
-rw-r--r--sysdep/unix/io.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 4455fc19..8c9052a3 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -55,6 +55,7 @@
this to gen small latencies */
#define MAX_RX_STEPS 4
+
/*
* Tracked Files
*/
@@ -89,17 +90,29 @@ static struct resclass rf_class = {
NULL
};
-void *
-tracked_fopen(pool *p, char *name, char *mode)
+struct rfile *
+rf_open(pool *p, char *name, char *mode)
{
FILE *f = fopen(name, mode);
- if (f)
- {
- struct rfile *r = ralloc(p, &rf_class);
- r->f = f;
- }
- return f;
+ if (!f)
+ return NULL;
+
+ struct rfile *r = ralloc(p, &rf_class);
+ r->f = f;
+ return r;
+}
+
+void *
+rf_file(struct rfile *f)
+{
+ return f->f;
+}
+
+int
+rf_fileno(struct rfile *f)
+{
+ return fileno(f->f);
}