| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * 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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 773 |
| 774 NaClLog(3, | 774 NaClLog(3, |
| 775 "Entered NaClCommonSysWrite(0x%08"NACL_PRIxPTR", " | 775 "Entered NaClCommonSysWrite(0x%08"NACL_PRIxPTR", " |
| 776 "%d, 0x%08"NACL_PRIxPTR", " | 776 "%d, 0x%08"NACL_PRIxPTR", " |
| 777 "%"NACL_PRIdS"[0x%"NACL_PRIxS"])\n", | 777 "%"NACL_PRIdS"[0x%"NACL_PRIxS"])\n", |
| 778 (uintptr_t) natp, d, (uintptr_t) buf, count, count); | 778 (uintptr_t) natp, d, (uintptr_t) buf, count, count); |
| 779 | 779 |
| 780 NaClSysCommonThreadSyscallEnter(natp); | 780 NaClSysCommonThreadSyscallEnter(natp); |
| 781 | 781 |
| 782 ndp = NaClGetDesc(natp->nap, d); | 782 ndp = NaClGetDesc(natp->nap, d); |
| 783 NaClLog(4, " ndp = %"NACL_PRIxPTR"\n", (uintptr_t) ndp); |
| 783 if (NULL == ndp) { | 784 if (NULL == ndp) { |
| 784 retval = -NACL_ABI_EBADF; | 785 retval = -NACL_ABI_EBADF; |
| 785 goto cleanup; | 786 goto cleanup; |
| 786 } | 787 } |
| 787 | 788 |
| 788 sysaddr = NaClUserToSysAddrRange(natp->nap, (uintptr_t) buf, count); | 789 sysaddr = NaClUserToSysAddrRange(natp->nap, (uintptr_t) buf, count); |
| 789 if (kNaClBadAddress == sysaddr) { | 790 if (kNaClBadAddress == sysaddr) { |
| 790 NaClDescUnref(ndp); | 791 NaClDescUnref(ndp); |
| 791 retval = -NACL_ABI_EFAULT; | 792 retval = -NACL_ABI_EFAULT; |
| 792 goto cleanup; | 793 goto cleanup; |
| (...skipping 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 # else | 2792 # else |
| 2792 # error Unsupported platform | 2793 # error Unsupported platform |
| 2793 # endif | 2794 # endif |
| 2794 | 2795 |
| 2795 #endif | 2796 #endif |
| 2796 | 2797 |
| 2797 UNREFERENCED_PARAMETER(natp); | 2798 UNREFERENCED_PARAMETER(natp); |
| 2798 | 2799 |
| 2799 return -NACL_ABI_ENOSYS; | 2800 return -NACL_ABI_ENOSYS; |
| 2800 } | 2801 } |
| OLD | NEW |