OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * NaCl service run-time, non-platform specific system call helper routines. | 8 * NaCl service run-time, non-platform specific system call helper routines. |
9 */ | 9 */ |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 | 1724 |
1725 ssize_retval = NaClImcSendTypedMessage(ndp, &kern_msg_hdr, flags); | 1725 ssize_retval = NaClImcSendTypedMessage(ndp, &kern_msg_hdr, flags); |
1726 | 1726 |
1727 if (NaClIsNegErrno(ssize_retval)) { | 1727 if (NaClIsNegErrno(ssize_retval)) { |
1728 /* | 1728 /* |
1729 * NaClWouldBlock uses TSD (for both the errno-based and | 1729 * NaClWouldBlock uses TSD (for both the errno-based and |
1730 * GetLastError()-based implementations), so this is threadsafe. | 1730 * GetLastError()-based implementations), so this is threadsafe. |
1731 */ | 1731 */ |
1732 if (0 != (flags & NACL_DONT_WAIT) && NaClWouldBlock()) { | 1732 if (0 != (flags & NACL_DONT_WAIT) && NaClWouldBlock()) { |
1733 retval = -NACL_ABI_EAGAIN; | 1733 retval = -NACL_ABI_EAGAIN; |
| 1734 } else if (-NACL_ABI_EMSGSIZE == ssize_retval) { |
| 1735 /* |
| 1736 * Allow the caller to handle the case when imc_sendmsg fails because |
| 1737 * the message is too large for the system to send in one piece. |
| 1738 */ |
| 1739 retval = -NACL_ABI_EMSGSIZE; |
1734 } else { | 1740 } else { |
1735 /* | 1741 /* |
1736 * TODO(bsy): the else case is some mysterious internal error. | 1742 * TODO(bsy): the else case is some mysterious internal error. |
1737 * Should we destroy the ndp or otherwise mark it as bad? Was | 1743 * Should we destroy the ndp or otherwise mark it as bad? Was |
1738 * the failure atomic? Did it send some partial data? Linux | 1744 * the failure atomic? Did it send some partial data? Linux |
1739 * implementation appears okay. | 1745 * implementation appears okay. |
1740 */ | 1746 */ |
1741 retval = -NACL_ABI_EIO; | 1747 retval = -NACL_ABI_EIO; |
1742 } | 1748 } |
1743 } else if (ssize_retval > INT32_MAX || ssize_retval < INT32_MIN) { | 1749 } else if (ssize_retval > INT32_MAX || ssize_retval < INT32_MIN) { |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2734 void *code_target, | 2740 void *code_target, |
2735 void *code_buffer, | 2741 void *code_buffer, |
2736 size_t code_size) { | 2742 size_t code_size) { |
2737 UNREFERENCED_PARAMETER(natp); | 2743 UNREFERENCED_PARAMETER(natp); |
2738 UNREFERENCED_PARAMETER(code_target); | 2744 UNREFERENCED_PARAMETER(code_target); |
2739 UNREFERENCED_PARAMETER(code_buffer); | 2745 UNREFERENCED_PARAMETER(code_buffer); |
2740 UNREFERENCED_PARAMETER(code_size); | 2746 UNREFERENCED_PARAMETER(code_size); |
2741 | 2747 |
2742 return -NACL_ABI_ENOSYS; | 2748 return -NACL_ABI_ENOSYS; |
2743 } | 2749 } |
OLD | NEW |