Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(974)

Unified Diff: sysdeps/nacl/sysdep.h

Issue 10095013: fixed signatures for several syscalls that return positive value in correct case (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: done. thanks @khim Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sysdeps/nacl/sysdep.h
diff --git a/sysdeps/nacl/sysdep.h b/sysdeps/nacl/sysdep.h
index cea7b73fc5aeb28917348940ca077e2234e653b0..c8f96ed2af45ec961256679daf0194edcf77aed6 100644
--- a/sysdeps/nacl/sysdep.h
+++ b/sysdeps/nacl/sysdep.h
@@ -240,8 +240,9 @@ INTERNAL_SYSCALL_dup3_3 (int *err, int oldfd, int newfd, int flags)
__extern_always_inline int
INTERNAL_SYSCALL_epoll_create_1 (int *err, int size)
{
- *err = __nacl_irt_epoll_create (size);
- return 0;
+ int fd;
+ *err = __nacl_irt_epoll_create (size, &fd);
+ return fd;
}
__extern_always_inline int
@@ -257,9 +258,10 @@ INTERNAL_SYSCALL_epoll_pwait_6 (int *err, int epfd, struct epoll_event *events,
int maxevents, int timeout,
const sigset_t *sigmask, size_t sigset_size)
{
+ int count;
*err = __nacl_irt_epoll_pwait (epfd, events, maxevents, timeout, sigmask,
- sigset_size);
- return 0;
+ sigset_size, &count);
+ return count;
}
__extern_always_inline int
@@ -274,9 +276,9 @@ __extern_always_inline int
INTERNAL_SYSCALL_epoll_wait_4 (int *err, int epfd, struct epoll_event *events,
int maxevents, int timeout)
{
- *err = (38 /* ENOSYS */);
- *err = __nacl_irt_epoll_wait (epfd, events, maxevents, timeout);
- return 0;
+ int count;
+ *err = __nacl_irt_epoll_wait (epfd, events, maxevents, timeout, &count);
+ return count;
}
__extern_always_inline int
@@ -1159,8 +1161,9 @@ INTERNAL_SYSCALL_pivot_root_2 (int *err, const char *new_root,
__extern_always_inline int
INTERNAL_SYSCALL_poll_3 (int *err, struct pollfd *fds, nfds_t nfds, int timeout)
{
- *err = __nacl_irt_poll (fds, nfds, timeout);
- return 0;
+ int count;
+ *err = __nacl_irt_poll (fds, nfds, timeout, &count);
+ return count;
}
__extern_always_inline int
@@ -1168,8 +1171,9 @@ INTERNAL_SYSCALL_ppoll_5 (int *err, struct pollfd *fds, nfds_t nfds,
const struct timespec *timeout,
const sigset_t *sigmask, size_t sigset_size)
{
- *err = __nacl_irt_ppoll (fds, nfds, timeout, sigmask, sigset_size);
- return 0;
+ int count;
+ *err = __nacl_irt_ppoll (fds, nfds, timeout, sigmask, sigset_size, &count);
+ return count;
}
__extern_always_inline int
@@ -1187,9 +1191,10 @@ INTERNAL_SYSCALL_pselect6_6 (int *err, int nfds, fd_set *readfds,
const struct timeval *timeout,
void *sigmask)
{
+ int count;
*err = __nacl_irt_pselect (nfds, readfds, writefds, exceptfds, timeout,
- sigmask);
- return 0;
+ sigmask, &count);
+ return count;
}
__extern_always_inline long
@@ -1424,8 +1429,9 @@ INTERNAL_SYSCALL_select_5 (int *err, int nfds, fd_set *readfds,
fd_set *writefds, fd_set *exceptfds,
const struct timeval *timeout)
{
- *err = __nacl_irt_select (nfds, readfds, writefds, exceptfds, timeout);
- return 0;
+ int count;
+ *err = __nacl_irt_select (nfds, readfds, writefds, exceptfds, timeout, &count);
+ return count;
}
__extern_always_inline int
@@ -1646,16 +1652,18 @@ INTERNAL_SYSCALL_signalfd_3 (int *err, int fd, const sigset_t *mask,
__extern_always_inline int
INTERNAL_SYSCALL_socket_3 (int *err, int domain, int type, int protocol)
{
- *err = __nacl_irt_socket (domain, type, protocol);
- return 0;
+ int sd;
+ *err = __nacl_irt_socket (domain, type, protocol, &sd);
+ return sd;
}
__extern_always_inline int
INTERNAL_SYSCALL_accept_3 (int *err, int sockfd, struct sockaddr* addr,
socklen_t* addr_len)
{
- *err = __nacl_irt_accept (sockfd, addr, addr_len);
- return 0;
+ int sd;
+ *err = __nacl_irt_accept (sockfd, addr, addr_len, &sd);
+ return sd;
}
__extern_always_inline int

Powered by Google App Engine
This is Rietveld 408576698