aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/skas/process.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-05-06 17:51:35 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:13:03 -0400
commita61f334fd2864b9b040f7e882726426ed7e8a317 (patch)
tree51874236a1f324a2664118f54aadd9ba3beb95ca /arch/um/os-Linux/skas/process.c
parentef0470c053274c343b2be8737e0146d65e17f9be (diff)
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/skas/process.c')
-rw-r--r--arch/um/os-Linux/skas/process.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index 47852698d5e1..5b1943dc15e9 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -431,12 +431,13 @@ void map_stub_pages(int fd, unsigned long code,
431 .fd = code_fd, 431 .fd = code_fd,
432 .offset = code_offset 432 .offset = code_offset
433 } } }); 433 } } });
434 n = os_write_file(fd, &mmop, sizeof(mmop)); 434 CATCH_EINTR(n = write(fd, &mmop, sizeof(mmop)));
435 if(n != sizeof(mmop)){ 435 if(n != sizeof(mmop)){
436 n = errno;
436 printk("mmap args - addr = 0x%lx, fd = %d, offset = %llx\n", 437 printk("mmap args - addr = 0x%lx, fd = %d, offset = %llx\n",
437 code, code_fd, (unsigned long long) code_offset); 438 code, code_fd, (unsigned long long) code_offset);
438 panic("map_stub_pages : /proc/mm map for code failed, " 439 panic("map_stub_pages : /proc/mm map for code failed, "
439 "err = %d\n", -n); 440 "err = %d\n", n);
440 } 441 }
441 442
442 if ( stack ) { 443 if ( stack ) {
@@ -453,10 +454,10 @@ void map_stub_pages(int fd, unsigned long code,
453 .fd = map_fd, 454 .fd = map_fd,
454 .offset = map_offset 455 .offset = map_offset
455 } } }); 456 } } });
456 n = os_write_file(fd, &mmop, sizeof(mmop)); 457 CATCH_EINTR(n = write(fd, &mmop, sizeof(mmop)));
457 if(n != sizeof(mmop)) 458 if(n != sizeof(mmop))
458 panic("map_stub_pages : /proc/mm map for data failed, " 459 panic("map_stub_pages : /proc/mm map for data failed, "
459 "err = %d\n", -n); 460 "err = %d\n", errno);
460 } 461 }
461} 462}
462 463