diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-05-06 23:51:35 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 21:13:03 +0200 |
commit | a61f334fd2864b9b040f7e882726426ed7e8a317 (patch) | |
tree | 51874236a1f324a2664118f54aadd9ba3beb95ca /arch/um/os-Linux/process.c | |
parent | uml: tidy libc code (diff) | |
download | linux-a61f334fd2864b9b040f7e882726426ed7e8a317.tar.xz linux-a61f334fd2864b9b040f7e882726426ed7e8a317.zip |
uml: convert libc layer to call read and write
This patch converts calls in the os layer to os_{read,write}_file to calls
directly to libc read() and write() where it is clear that the I/O buffer is
in the kernel.
We can do that here instead of calling os_{read,write}_file_k since we are in
libc code and can call libc directly.
With the change in the calls, error handling needs to be changed to refer to
errno directly rather than the return value of the call.
CATCH_EINTR wrappers were also added where needed.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/process.c')
-rw-r--r-- | arch/um/os-Linux/process.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index a84a45843f83..92a7b59120d6 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c @@ -42,10 +42,10 @@ unsigned long os_process_pc(int pid) proc_stat, -fd); return ARBITRARY_ADDR; } - err = os_read_file(fd, buf, sizeof(buf)); + CATCH_EINTR(err = read(fd, buf, sizeof(buf))); if(err < 0){ printk("os_process_pc - couldn't read '%s', err = %d\n", - proc_stat, -err); + proc_stat, errno); os_close_file(fd); return ARBITRARY_ADDR; } @@ -75,11 +75,11 @@ int os_process_parent(int pid) return FAILURE_PID; } - n = os_read_file(fd, data, sizeof(data)); + CATCH_EINTR(n = read(fd, data, sizeof(data))); os_close_file(fd); if(n < 0){ - printk("Couldn't read '%s', err = %d\n", stat, -n); + printk("Couldn't read '%s', err = %d\n", stat, errno); return FAILURE_PID; } |