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

Side by Side Diff: src/shared/platform/linux/nacl_host_dir.c

Issue 1235633004: DON'T USE THIS -- Providing some missing POSIX File syscalls. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | src/shared/platform/nacl_host_desc.h » ('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) 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 Runtime. Directory descriptor / Handle abstraction. 8 * NaCl Service Runtime. Directory descriptor / Handle abstraction.
9 * 9 *
10 * Note that we avoid using the thread-specific data / thread local 10 * Note that we avoid using the thread-specific data / thread local
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 if (NULL == d) { 321 if (NULL == d) {
322 NaClLog(LOG_FATAL, "NaClHostDirClose: 'this' is NULL\n"); 322 NaClLog(LOG_FATAL, "NaClHostDirClose: 'this' is NULL\n");
323 } 323 }
324 NaClLog(3, "NaClHostDirClose(%d)\n", d->fd); 324 NaClLog(3, "NaClHostDirClose(%d)\n", d->fd);
325 retval = close(d->fd); 325 retval = close(d->fd);
326 d->fd = -1; 326 d->fd = -1;
327 NaClMutexDtor(&d->mu); 327 NaClMutexDtor(&d->mu);
328 return (-1 == retval) ? -NaClXlateErrno(errno) : retval; 328 return (-1 == retval) ? -NaClXlateErrno(errno) : retval;
329 } 329 }
330
331 int NaClHostDirFchdir(struct NaClHostDir *d) {
332 if (-1 == fchdir(d->fd)) {
333 return -NaClXlateErrno(errno);
334 }
335 return 0;
336 }
337
338 int NaClHostDirFchmod(struct NaClHostDir *d, int mode) {
339 if (-1 == fchmod(d->fd, mode)) {
340 return -NaClXlateErrno(errno);
341 }
342 return 0;
343 }
344
345 int NaClHostDirFsync(struct NaClHostDir *d) {
346 if (-1 == fsync(d->fd)) {
347 return -NaClXlateErrno(errno);
348 }
349 return 0;
350 }
351
352 int NaClHostDirFdatasync(struct NaClHostDir *d) {
353 if (-1 == fdatasync(d->fd)) {
354 return -NaClXlateErrno(errno);
355 }
356 return 0;
357 }
OLDNEW
« no previous file with comments | « no previous file | src/shared/platform/nacl_host_desc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698