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

Unified Diff: src/trusted/service_runtime/posix/nacl_syscall_impl.c

Issue 23710020: Deduplicates NaClSysSysconf implementation (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Code review feedback Created 7 years, 3 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: src/trusted/service_runtime/posix/nacl_syscall_impl.c
diff --git a/src/trusted/service_runtime/posix/nacl_syscall_impl.c b/src/trusted/service_runtime/posix/nacl_syscall_impl.c
index 1bb356d9391b3dbc1849a33a47a0a565a1894756..812ffc8851c6456c76a25139bae54a5424b03161 100644
--- a/src/trusted/service_runtime/posix/nacl_syscall_impl.c
+++ b/src/trusted/service_runtime/posix/nacl_syscall_impl.c
@@ -74,49 +74,3 @@ int32_t NaClSysClock(struct NaClAppThread *natp) {
retval = clock();
return retval;
}
-
-int32_t NaClSysSysconf(struct NaClAppThread *natp,
- int32_t name,
- int32_t *result) {
- int32_t retval = -NACL_ABI_EINVAL;
- int32_t result_value;
-
- NaClLog(3,
- ("Entered NaClSysSysconf(%08"NACL_PRIxPTR
- "x, %d, 0x%08"NACL_PRIxPTR")\n"),
- (uintptr_t) natp, name, (uintptr_t) result);
-
- switch (name) {
- case NACL_ABI__SC_NPROCESSORS_ONLN: {
- if (-1 == natp->nap->sc_nprocessors_onln) {
- /* Unable to get the number of processors at startup. */
- retval = -NACL_ABI_EINVAL;
- goto cleanup;
- }
- result_value = natp->nap->sc_nprocessors_onln;
- break;
- }
- case NACL_ABI__SC_SENDMSG_MAX_SIZE: {
- /* TODO(sehr,bsy): this value needs to be determined at run time. */
- const int32_t kImcSendMsgMaxSize = 1 << 16;
- result_value = kImcSendMsgMaxSize;
- break;
- }
- case NACL_ABI__SC_PAGESIZE: {
- result_value = 1 << 16; /* always 64k pages */
- break;
- }
- default: {
- retval = -NACL_ABI_EINVAL;
- goto cleanup;
- }
- }
- if (!NaClCopyOutToUser(natp->nap, (uintptr_t) result, &result_value,
- sizeof result_value)) {
- retval = -NACL_ABI_EFAULT;
- goto cleanup;
- }
- retval = 0;
-cleanup:
- return retval;
-}
« no previous file with comments | « src/trusted/service_runtime/nacl_syscall_common.c ('k') | src/trusted/service_runtime/win/nacl_syscall_impl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698