| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LIBRARIES_NACL_IO_KERNEL_WRAP_H_ | 5 #ifndef LIBRARIES_NACL_IO_KERNEL_WRAP_H_ |
| 6 #define LIBRARIES_NACL_IO_KERNEL_WRAP_H_ | 6 #define LIBRARIES_NACL_IO_KERNEL_WRAP_H_ |
| 7 | 7 |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <stdint.h> |
| 9 #include <stdlib.h> | 10 #include <stdlib.h> |
| 11 |
| 10 #include "nacl_io/ostypes.h" | 12 #include "nacl_io/ostypes.h" |
| 11 #include "nacl_io/osutime.h" | 13 #include "nacl_io/osutime.h" |
| 12 #include "sdk_util/macros.h" | 14 #include "sdk_util/macros.h" |
| 13 | 15 |
| 14 #if defined(__GLIBC__) | 16 #if defined(__GLIBC__) |
| 15 #include <sys/cdefs.h> | 17 #include <sys/cdefs.h> |
| 16 #define NOTHROW __THROW | 18 #define NOTHROW __THROW |
| 17 #else | 19 #else |
| 18 #define NOTHROW | 20 #define NOTHROW |
| 19 #endif | 21 #endif |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 #define NAME(x) x | 34 #define NAME(x) x |
| 33 #endif | 35 #endif |
| 34 | 36 |
| 35 EXTERN_C_BEGIN | 37 EXTERN_C_BEGIN |
| 36 | 38 |
| 37 void kernel_wrap_init(); | 39 void kernel_wrap_init(); |
| 38 | 40 |
| 39 int NAME(access)(const char* path, int amode) NOTHROW; | 41 int NAME(access)(const char* path, int amode) NOTHROW; |
| 40 int NAME(chdir)(const char* path) NOTHROW; | 42 int NAME(chdir)(const char* path) NOTHROW; |
| 41 int NAME(chmod)(const char* path, chmod_mode_t mode) NOTHROW; | 43 int NAME(chmod)(const char* path, chmod_mode_t mode) NOTHROW; |
| 42 int chown(const char* path, uid_t owner, gid_t group); | 44 int chown(const char* path, uid_t owner, gid_t group) NOTHROW; |
| 43 int NAME(close)(int fd); | 45 int NAME(close)(int fd); |
| 44 int NAME(dup)(int oldfd) NOTHROW; | 46 int NAME(dup)(int oldfd) NOTHROW; |
| 45 int NAME(dup2)(int oldfd, int newfd) NOTHROW; | 47 int NAME(dup2)(int oldfd, int newfd) NOTHROW; |
| 46 int fchown(int fd, uid_t owner, gid_t group); | 48 int fchown(int fd, uid_t owner, gid_t group) NOTHROW; |
| 47 #if defined(WIN32) | 49 #if defined(WIN32) |
| 48 int _fstat32(int fd, struct _stat32* buf); | 50 int _fstat32(int fd, struct _stat32* buf); |
| 49 int _fstat64(int fd, struct _stat64* buf); | 51 int _fstat64(int fd, struct _stat64* buf); |
| 50 int _fstat32i64(int fd, struct _stat32i64* buf); | 52 int _fstat32i64(int fd, struct _stat32i64* buf); |
| 51 int _fstat64i32(int fd, struct _stat64i32* buf); | 53 int _fstat64i32(int fd, struct _stat64i32* buf); |
| 52 #else | 54 #else |
| 53 struct stat; | 55 struct stat; |
| 54 int fstat(int fd, struct stat* buf) NOTHROW; | 56 int fstat(int fd, struct stat* buf) NOTHROW; |
| 55 #endif | 57 #endif |
| 56 int fsync(int fd); | 58 int fsync(int fd); |
| 57 int ftruncate(int fd, off_t length) NOTHROW; | 59 int ftruncate(int fd, off_t length) NOTHROW; |
| 58 char* NAME(getcwd)(char* buf, getcwd_size_t size) NOTHROW; | 60 char* NAME(getcwd)(char* buf, getcwd_size_t size) NOTHROW; |
| 59 char* getwd(char* buf) NOTHROW; | 61 char* getwd(char* buf) NOTHROW; |
| 60 int getdents(int fd, void* buf, unsigned int count) NOTHROW; | 62 int getdents(int fd, void* buf, unsigned int count) NOTHROW; |
| 61 int ioctl(int d, int request, char* argp) NOTHROW; | 63 int ioctl(int d, int request, char* argp) NOTHROW; |
| 62 int NAME(isatty)(int fd) NOTHROW; | 64 int NAME(isatty)(int fd) NOTHROW; |
| 63 int lchown(const char* path, uid_t owner, gid_t group); | 65 int lchown(const char* path, uid_t owner, gid_t group) NOTHROW; |
| 64 int link(const char* oldpath, const char* newpath) NOTHROW; | 66 int link(const char* oldpath, const char* newpath) NOTHROW; |
| 65 off_t NAME(lseek)(int fd, off_t offset, int whence) NOTHROW; | 67 off_t NAME(lseek)(int fd, off_t offset, int whence) NOTHROW; |
| 66 #if defined(WIN32) | 68 #if defined(WIN32) |
| 67 int _mkdir(const char* path); | 69 int _mkdir(const char* path); |
| 68 #else | 70 #else |
| 69 int mkdir(const char* path, mode_t mode) NOTHROW; | 71 int mkdir(const char* path, mode_t mode) NOTHROW; |
| 70 #endif | 72 #endif |
| 71 void* mmap(void* addr, size_t length, int prot, int flags, int fd, | 73 void* mmap(void* addr, size_t length, int prot, int flags, int fd, |
| 72 off_t offset) NOTHROW; | 74 off_t offset) NOTHROW; |
| 73 int mount(const char* source, const char* target, const char* filesystemtype, | 75 int mount(const char* source, const char* target, const char* filesystemtype, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 84 int _stat64i32(const char* path, struct _stat64i32* buf); | 86 int _stat64i32(const char* path, struct _stat64i32* buf); |
| 85 #else | 87 #else |
| 86 int stat(const char* path, struct stat* buf) NOTHROW; | 88 int stat(const char* path, struct stat* buf) NOTHROW; |
| 87 #endif | 89 #endif |
| 88 int symlink(const char* oldpath, const char* newpath) NOTHROW; | 90 int symlink(const char* oldpath, const char* newpath) NOTHROW; |
| 89 int umount(const char* path) NOTHROW; | 91 int umount(const char* path) NOTHROW; |
| 90 int NAME(unlink)(const char* path) NOTHROW; | 92 int NAME(unlink)(const char* path) NOTHROW; |
| 91 int utime(const char* filename, const struct utimbuf* times); | 93 int utime(const char* filename, const struct utimbuf* times); |
| 92 read_ssize_t NAME(write)(int fd, const void* buf, size_t nbyte); | 94 read_ssize_t NAME(write)(int fd, const void* buf, size_t nbyte); |
| 93 | 95 |
| 96 uint64_t usec_since_epoch(); |
| 97 |
| 94 EXTERN_C_END | 98 EXTERN_C_END |
| 95 | 99 |
| 96 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ | 100 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ |
| OLD | NEW |