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. I/O Descriptor / Handle abstraction. Memory | 8 * NaCl Service Runtime. I/O Descriptor / Handle abstraction. Memory |
9 * mapping using descriptors. | 9 * mapping using descriptors. |
10 */ | 10 */ |
11 | 11 |
12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_HOST_DESC_H__ | 12 #ifndef NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_HOST_DESC_H__ |
13 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_HOST_DESC_H__ | 13 #define NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_HOST_DESC_H__ |
14 | 14 |
15 #include <sys/stat.h> | 15 #include <sys/stat.h> |
16 | 16 |
17 #include "native_client/src/include/nacl_compiler_annotations.h" | 17 #include "native_client/src/include/nacl_compiler_annotations.h" |
18 #include "native_client/src/include/portability.h" | 18 #include "native_client/src/include/portability.h" |
19 #include "native_client/src/shared/platform/nacl_sync.h" | 19 #include "native_client/src/shared/platform/nacl_sync.h" |
| 20 #include "native_client/src/trusted/service_runtime/include/sys/time.h" |
20 | 21 |
21 #if NACL_LINUX || NACL_OSX | 22 #if NACL_LINUX || NACL_OSX |
22 # include "native_client/src/shared/platform/posix/nacl_host_desc_types.h" | 23 # include "native_client/src/shared/platform/posix/nacl_host_desc_types.h" |
23 #elif NACL_WINDOWS | 24 #elif NACL_WINDOWS |
24 # include "native_client/src/shared/platform/win/nacl_host_desc_types.h" | 25 # include "native_client/src/shared/platform/win/nacl_host_desc_types.h" |
25 #endif | 26 #endif |
26 | 27 |
27 | 28 |
28 | 29 |
29 /* | 30 /* |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 * be NULL. | 327 * be NULL. |
327 */ | 328 */ |
328 extern int NaClHostDescGetcwd(char *path, size_t len) NACL_WUR; | 329 extern int NaClHostDescGetcwd(char *path, size_t len) NACL_WUR; |
329 | 330 |
330 /* | 331 /* |
331 * Remove/delete the underlying file. | 332 * Remove/delete the underlying file. |
332 * Underlying host-OS functions: unlink(2) / _unlink | 333 * Underlying host-OS functions: unlink(2) / _unlink |
333 */ | 334 */ |
334 extern int NaClHostDescUnlink(char const *path) NACL_WUR; | 335 extern int NaClHostDescUnlink(char const *path) NACL_WUR; |
335 | 336 |
| 337 extern int NaClHostDescTruncate(const char *path, |
| 338 nacl_off64_t length) NACL_WUR; |
| 339 |
| 340 extern int NaClHostDescLstat(char const *host_os_pathname, |
| 341 nacl_host_stat_t *nasp) NACL_WUR; |
| 342 |
| 343 extern int NaClHostDescLink(const char *oldpath, |
| 344 const char *newpath) NACL_WUR; |
| 345 |
| 346 extern int NaClHostDescChmod(const char *path, int mode) NACL_WUR; |
| 347 |
| 348 extern int NaClHostDescAccess(const char *pathname, int mode) NACL_WUR; |
| 349 |
| 350 extern int NaClHostDescRename(const char *oldpath, |
| 351 const char *newpath) NACL_WUR; |
| 352 |
| 353 extern int NaClHostDescReadlink(const char *path, |
| 354 char *buf, |
| 355 size_t bufsiz) NACL_WUR; |
| 356 |
| 357 extern int NaClHostDescSymlink(const char *oldpath, |
| 358 const char *newpath) NACL_WUR; |
| 359 |
| 360 extern int NaClHostDescUtimes(const char *filename, |
| 361 const struct nacl_abi_timeval times[2]) NACL_WUR; |
| 362 |
| 363 extern int NaClHostDescFchmod(struct NaClHostDesc *d, int mode) NACL_WUR; |
| 364 |
| 365 extern int NaClHostDescFsync(struct NaClHostDesc *d) NACL_WUR; |
| 366 |
| 367 extern int NaClHostDescFdatasync(struct NaClHostDesc *d) NACL_WUR; |
| 368 |
| 369 extern int NaClHostDescFtruncate(struct NaClHostDesc *d, |
| 370 nacl_off64_t length) NACL_WUR; |
| 371 |
336 /* | 372 /* |
337 * Maps NACI_ABI_ versions of the mmap prot argument to host ABI versions | 373 * Maps NACI_ABI_ versions of the mmap prot argument to host ABI versions |
338 * of the bit values | 374 * of the bit values |
339 */ | 375 */ |
340 extern int NaClProtMap(int abi_prot); | 376 extern int NaClProtMap(int abi_prot); |
341 | 377 |
342 /* | 378 /* |
343 * Utility routine. Checks |d| is non-NULL, and that d->d is not -1. | 379 * Utility routine. Checks |d| is non-NULL, and that d->d is not -1. |
344 * If either is true, an appropriate LOG_FATAL message with |fn_name| | 380 * If either is true, an appropriate LOG_FATAL message with |fn_name| |
345 * interpolated is generated. | 381 * interpolated is generated. |
(...skipping 11 matching lines...) Expand all Loading... |
357 char const **out_msg); | 393 char const **out_msg); |
358 | 394 |
359 extern DWORD NaClflProtectMap(int prot); | 395 extern DWORD NaClflProtectMap(int prot); |
360 #endif | 396 #endif |
361 | 397 |
362 EXTERN_C_END | 398 EXTERN_C_END |
363 | 399 |
364 #endif /* defined __native_client__ */ | 400 #endif /* defined __native_client__ */ |
365 | 401 |
366 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_HOST_DESC_H__ */ | 402 #endif /* NATIVE_CLIENT_SRC_TRUSTED_PLATFORM_NACL_HOST_DESC_H__ */ |
OLD | NEW |