| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 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 #include "native_client/src/include/portability.h" | 10 #include "native_client/src/include/portability.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 int NaClHostDirClose(struct NaClHostDir *d) { | 263 int NaClHostDirClose(struct NaClHostDir *d) { |
| 264 if (NULL == d) { | 264 if (NULL == d) { |
| 265 NaClLog(LOG_FATAL, "NaClHostDirClose: 'this' is NULL\n"); | 265 NaClLog(LOG_FATAL, "NaClHostDirClose: 'this' is NULL\n"); |
| 266 } | 266 } |
| 267 NaClMutexDtor(&d->mu); | 267 NaClMutexDtor(&d->mu); |
| 268 if (!FindClose(d->handle)) { | 268 if (!FindClose(d->handle)) { |
| 269 return -NaClXlateSystemError(GetLastError()); | 269 return -NaClXlateSystemError(GetLastError()); |
| 270 } | 270 } |
| 271 return 0; | 271 return 0; |
| 272 } | 272 } |
| 273 |
| 274 int NaClHostDirFchdir(struct NaClHostDir *d) { |
| 275 NaClLog(1, "NaClHostDirFchdir Not yet implemented.\n"); |
| 276 /* TODO(smklein) Implement this function */ |
| 277 |
| 278 return -NACL_ABI_EINVAL; |
| 279 } |
| 280 |
| 281 int NaClHostDirFchmod(struct NaClHostDir *d, int mode) { |
| 282 NaClLog(1, "NaClHostDirFchmod Not yet implemented.\n"); |
| 283 /* TODO(smklein) Implement this function */ |
| 284 |
| 285 return -NACL_ABI_EINVAL; |
| 286 } |
| 287 |
| 288 int NaClHostDirFsync(struct NaClHostDir *d) { |
| 289 DWORD err; |
| 290 |
| 291 if (!FlushFileBuffers(d->handle)) { |
| 292 err = GetLastError(); |
| 293 return -NaClXlateSystemError(err); |
| 294 } |
| 295 |
| 296 return 0; |
| 297 } |
| 298 |
| 299 int NaClHostDirFdatasync(struct NaClHostDir *d) { |
| 300 DWORD err; |
| 301 |
| 302 if (!FlushFileBuffers(d->handle)) { |
| 303 err = GetLastError(); |
| 304 return -NaClXlateSystemError(err); |
| 305 } |
| 306 |
| 307 return 0; |
| 308 } |
| OLD | NEW |