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

Side by Side Diff: tests/quake/nacl_file.c

Issue 5622003: Restructure the structs/unions involved in SRPC argument passing. This will... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/photo/photo.cc ('k') | tests/ruby/main.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2008 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that be 3 * Use of this source code is governed by a BSD-style license that be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 NaClSrpcArg **in_args, \ 52 NaClSrpcArg **in_args, \
53 NaClSrpcArg **out_args, \ 53 NaClSrpcArg **out_args, \
54 NaClSrpcClosure *done) 54 NaClSrpcClosure *done)
55 55
56 NACL_SRPC_HANDLER("file:shi:", NaClFile) { 56 NACL_SRPC_HANDLER("file:shi:", NaClFile) {
57 char *pathname; 57 char *pathname;
58 int fd; 58 int fd;
59 int last; 59 int last;
60 struct nacl_file_map *entry; 60 struct nacl_file_map *entry;
61 61
62 pathname = in_args[0]->u.sval; 62 pathname = in_args[0]->arrays.str;
63 fd = in_args[1]->u.ival; 63 fd = in_args[1]->u.ival;
64 last = in_args[2]->u.hval; 64 last = in_args[2]->u.hval;
65 65
66 printf("NaClFile(%s,%d,%d)\n", pathname, fd, last); 66 printf("NaClFile(%s,%d,%d)\n", pathname, fd, last);
67 67
68 entry = malloc(sizeof *entry); 68 entry = malloc(sizeof *entry);
69 69
70 if (NULL == entry) { 70 if (NULL == entry) {
71 fprintf(stderr, "No memory for file map for %s\n", pathname); 71 fprintf(stderr, "No memory for file map for %s\n", pathname);
72 exit(1); 72 exit(1);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 case SEEK_END: 228 case SEEK_END:
229 offset = __real_lseek(nacl_files[dd].real_fd, offset, SEEK_END); 229 offset = __real_lseek(nacl_files[dd].real_fd, offset, SEEK_END);
230 break; 230 break;
231 } 231 }
232 if (-1 != offset) { 232 if (-1 != offset) {
233 nacl_files[dd].pos = offset; 233 nacl_files[dd].pos = offset;
234 } 234 }
235 pthread_mutex_unlock(&nacl_files[dd].mu); 235 pthread_mutex_unlock(&nacl_files[dd].mu);
236 return offset; 236 return offset;
237 } 237 }
OLDNEW
« no previous file with comments | « tests/photo/photo.cc ('k') | tests/ruby/main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698