aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/runtime_c.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/runtime/runtime_c.c')
-rw-r--r--libgo/runtime/runtime_c.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libgo/runtime/runtime_c.c b/libgo/runtime/runtime_c.c
index 7531431..e7951a0 100644
--- a/libgo/runtime/runtime_c.c
+++ b/libgo/runtime/runtime_c.c
@@ -134,16 +134,22 @@ int32 go_read(int32, void *, int32)
int32
go_read(int32 fd, void *p, int32 n)
{
- return runtime_read(fd, p, n);
+ ssize_t r = runtime_read(fd, p, n);
+ if (r < 0)
+ r = - errno;
+ return (int32)r;
}
-int32 go_write(uintptr, void *, int32)
- __asm__ (GOSYM_PREFIX "runtime.write");
+int32 go_write1(uintptr, void *, int32)
+ __asm__ (GOSYM_PREFIX "runtime.write1");
int32
-go_write(uintptr fd, void *p, int32 n)
+go_write1(uintptr fd, void *p, int32 n)
{
- return runtime_write(fd, p, n);
+ ssize_t r = runtime_write(fd, p, n);
+ if (r < 0)
+ r = - errno;
+ return (int32)r;
}
int32 go_closefd(int32)