OLD | NEW |
1 | 1 |
2 #include <errno.h> | 2 #include <errno.h> |
3 #include <unistd.h> | 3 #include <unistd.h> |
4 #include <stddef.h> | 4 #include <stddef.h> |
5 | 5 |
6 #include <irt_syscalls.h> | 6 #include <irt_syscalls.h> |
7 | 7 |
8 | 8 |
9 ssize_t __libc_read (int fd, void *buf, size_t size) | 9 ssize_t __libc_read (int fd, void *buf, size_t size) |
10 { | 10 { |
11 int nread; | 11 size_t nread; |
12 int result = __nacl_irt_read (fd, buf, size, &nread); | 12 int result = __nacl_irt_read (fd, buf, size, &nread); |
13 if (result != 0) { | 13 if (result != 0) { |
14 errno = -result; | 14 errno = -result; |
15 return -1; | 15 return -1; |
16 } | 16 } |
17 return nread; | 17 return nread; |
18 } | 18 } |
19 libc_hidden_def (__libc_read) | 19 libc_hidden_def (__libc_read) |
20 weak_alias (__libc_read, __read) | 20 weak_alias (__libc_read, __read) |
21 libc_hidden_weak (__read) | 21 libc_hidden_weak (__read) |
22 weak_alias (__libc_read, read) | 22 weak_alias (__libc_read, read) |
23 strong_alias (__libc_read, __read_nocancel) | 23 strong_alias (__libc_read, __read_nocancel) |
OLD | NEW |