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

Side by Side Diff: src/trusted/desc/nacl_desc_imc.c

Issue 3687005: Report EMSGSIZE when appropriate for sendmsg (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/trusted/desc/nrd_xfer.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 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 Runtime. I/O Descriptor / Handle abstraction. 8 * NaCl Service Runtime. I/O Descriptor / Handle abstraction.
9 */ 9 */
10 10
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 int result; 195 int result;
196 196
197 NaClXMutexLock(&self->sendmsg_mu); 197 NaClXMutexLock(&self->sendmsg_mu);
198 result = NaClSendDatagram(self->base.h, dgram, flags); 198 result = NaClSendDatagram(self->base.h, dgram, flags);
199 NaClXMutexUnlock(&self->sendmsg_mu); 199 NaClXMutexUnlock(&self->sendmsg_mu);
200 200
201 if (-1 == result) { 201 if (-1 == result) {
202 #if NACL_WINDOWS 202 #if NACL_WINDOWS
203 return -NaClXlateSystemError(GetLastError()); 203 return -NaClXlateSystemError(GetLastError());
204 #elif NACL_LINUX || NACL_OSX 204 #elif NACL_LINUX || NACL_OSX
205 return -errno; 205 return -NaClXlateErrno(errno);
206 #else 206 #else
207 # error "Unknown target platform: cannot translate error code(s) from SendMsg" 207 # error "Unknown target platform: cannot translate error code(s) from SendMsg"
208 #endif 208 #endif
209 } 209 }
210 return result; 210 return result;
211 } 211 }
212 212
213 213
214 /* 214 /*
215 * NaClDescXferableDataDescSendMsg implements imc_sendmsg For 215 * NaClDescXferableDataDescSendMsg implements imc_sendmsg For
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 " non-zero handle_count\n")); 248 " non-zero handle_count\n"));
249 return -NACL_ABI_EINVAL; 249 return -NACL_ABI_EINVAL;
250 } 250 }
251 251
252 result = NaClSendDatagram(self->base.h, dgram, flags); 252 result = NaClSendDatagram(self->base.h, dgram, flags);
253 253
254 if (-1 == result) { 254 if (-1 == result) {
255 #if NACL_WINDOWS 255 #if NACL_WINDOWS
256 return -NaClXlateSystemError(GetLastError()); 256 return -NaClXlateSystemError(GetLastError());
257 #elif NACL_LINUX || NACL_OSX 257 #elif NACL_LINUX || NACL_OSX
258 return -errno; 258 return -NaClXlateErrno(errno);
259 #else 259 #else
260 # error "Unknown target platform: cannot translate error code(s) from SendMsg" 260 # error "Unknown target platform: cannot translate error code(s) from SendMsg"
261 #endif 261 #endif
262 } 262 }
263 return result; 263 return result;
264 } 264 }
265 265
266 266
267 /* 267 /*
268 * See discussion at NaClDescImcDescSendMsg for details. An 268 * See discussion at NaClDescImcDescSendMsg for details. An
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 *xfer->next_handle++ = NACL_INVALID_HANDLE; 467 *xfer->next_handle++ = NACL_INVALID_HANDLE;
468 *baseptr = (struct NaClDesc *) ndxdp; 468 *baseptr = (struct NaClDesc *) ndxdp;
469 rv = 0; 469 rv = 0;
470 470
471 cleanup: 471 cleanup:
472 if (rv < 0) { 472 if (rv < 0) {
473 free(ndxdp); 473 free(ndxdp);
474 } 474 }
475 return rv; 475 return rv;
476 } 476 }
OLDNEW
« no previous file with comments | « no previous file | src/trusted/desc/nrd_xfer.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698