| OLD | NEW |
| 1 #include <sys/socket.h> | 1 #include <sys/socket.h> |
| 2 #include <limits.h> | 2 #include <limits.h> |
| 3 #include "syscall.h" | 3 #include "syscall.h" |
| 4 #include "libc.h" | 4 #include "libc.h" |
| 5 | 5 |
| 6 ssize_t recvmsg(int fd, struct msghdr* msg, int flags) { | 6 ssize_t recvmsg(int fd, struct msghdr* msg, int flags) { |
| 7 ssize_t r; | 7 ssize_t r; |
| 8 #if LONG_MAX > INT_MAX | 8 #if LONG_MAX > INT_MAX |
| 9 struct msghdr h, *orig = msg; | 9 struct msghdr h, *orig = msg; |
| 10 if (msg) { | 10 if (msg) { |
| 11 h = *msg; | 11 h = *msg; |
| 12 h.__pad1 = h.__pad2 = 0; | 12 h.__pad1 = h.__pad2 = 0; |
| 13 msg = &h; | 13 msg = &h; |
| 14 } | 14 } |
| 15 #endif | 15 #endif |
| 16 r = socketcall_cp(recvmsg, fd, msg, flags, 0, 0, 0); | 16 r = syscall_cp(SYS_recvmsg, fd, msg, flags, 0, 0, 0); |
| 17 #if LONG_MAX > INT_MAX | 17 #if LONG_MAX > INT_MAX |
| 18 if (orig) | 18 if (orig) |
| 19 *orig = h; | 19 *orig = h; |
| 20 #endif | 20 #endif |
| 21 return r; | 21 return r; |
| 22 } | 22 } |
| OLD | NEW |