summaryrefslogtreecommitdiff
path: root/arch/um/os-Linux/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/file.c')
-rw-r--r--arch/um/os-Linux/file.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c
index 4a9510c67622..5e9b8dcf34d4 100644
--- a/arch/um/os-Linux/file.c
+++ b/arch/um/os-Linux/file.c
@@ -334,12 +334,30 @@ int os_read_file(int fd, void *buf, int len)
copy_from_user_proc);
}
+int os_read_file_k(int fd, void *buf, int len)
+{
+ int n = read(fd, buf, len);
+
+ if(n < 0)
+ return -errno;
+ return n;
+}
+
int os_write_file(int fd, const void *buf, int len)
{
return file_io(fd, (void *) buf, len,
(int (*)(int, void *, int)) write, copy_to_user_proc);
}
+int os_write_file_k(int fd, const void *buf, int len)
+{
+ int n = write(fd, (void *) buf, len);
+
+ if(n < 0)
+ return -errno;
+ return n;
+}
+
int os_file_size(char *file, unsigned long long *size_out)
{
struct uml_stat buf;