aboutsummaryrefslogtreecommitdiff
path: root/pk/file.h
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2013-07-13 21:43:57 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2013-07-13 21:44:16 -0700
commitcc72987e655578b0529b6c3c8084e810cf40b358 (patch)
treea7a99a9406dfef2d4103e85bc0976cb8d039d7e7 /pk/file.h
parent0bdb8c84092bf7c5eb4c981c620997a5893bfb70 (diff)
downloadpk-cc72987e655578b0529b6c3c8084e810cf40b358.zip
pk-cc72987e655578b0529b6c3c8084e810cf40b358.tar.gz
pk-cc72987e655578b0529b6c3c8084e810cf40b358.tar.bz2
Support Linux ABI and (optionally) virtual memory
Diffstat (limited to 'pk/file.h')
-rw-r--r--pk/file.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/pk/file.h b/pk/file.h
index 89d0523..42f47fc 100644
--- a/pk/file.h
+++ b/pk/file.h
@@ -16,14 +16,15 @@ typedef struct file
extern file_t *stdin, *stdout, *stderr;
file_t* file_get(int fd);
-sysret_t file_open(const char* fn, size_t len, int flags, int mode);
+sysret_t file_open(const char* fn, int flags, int mode);
void file_decref(file_t*);
+void file_incref(file_t*);
int file_dup(file_t*);
-sysret_t file_pwrite(file_t* f, const char* buf, size_t n, off_t off);
-sysret_t file_pread(file_t* f, char* buf, size_t n, off_t off);
-sysret_t file_write(file_t* f, const char* buf, size_t n);
-sysret_t file_read(file_t* f, char* buf, size_t n);
+sysret_t file_pwrite(file_t* f, const void* buf, size_t n, off_t off);
+sysret_t file_pread(file_t* f, void* buf, size_t n, off_t off);
+sysret_t file_write(file_t* f, const void* buf, size_t n);
+sysret_t file_read(file_t* f, void* buf, size_t n);
sysret_t file_stat(file_t* f, struct stat* s);
sysret_t file_lseek(file_t* f, size_t ptr, int dir);
int fd_close(int fd);