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

Side by Side Diff: native_client_sdk/src/libraries/nacl_mounts/kernel_wrap.h

Issue 11066105: [NaCl SDK] nacl_mounts: wrap functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 8 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
OLDNEW
(Empty)
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
3 * found in the LICENSE file.
4 */
5 #ifndef LIBRARIES_NACL_MOUNTS_KERNEL_WRAP_H_
6 #define LIBRARIES_NACL_MOUNTS_KERNEL_WRAP_H_
7
8 #include <sys/types.h>
9 #include <stdlib.h>
10 #include "utils/macros.h"
11
12 #if defined(__GLIBC__)
13 #include <sys/cdefs.h>
14 #define NOTHROW __THROW
15 #else
16 #define NOTHROW
17 #endif
18
19 #if defined(WIN32)
20 typedef int chmod_mode_t;
21 typedef int getcwd_size_t;
22 typedef int read_ssize_t;
23 typedef int write_ssize_t;
24 #define NAME(x) _##x
25 #else
26 typedef mode_t chmod_mode_t;
27 typedef size_t getcwd_size_t;
28 typedef ssize_t read_ssize_t;
29 typedef ssize_t write_ssize_t;
30 #define NAME(x) x
31 #endif
32
33 EXTERN_C_BEGIN
34
35 int NAME(access)(const char* path, int amode) NOTHROW;
36 int NAME(chdir)(const char* path) NOTHROW;
37 int NAME(chmod)(const char* path, chmod_mode_t mode) NOTHROW;
38 int NAME(close)(int fd);
39 int NAME(dup)(int oldfd) NOTHROW;
40 #if defined(WIN32)
41 int _fstat32(int fd, struct _stat32* buf);
42 int _fstat64(int fd, struct _stat64* buf);
43 int _fstat32i64(int fd, struct _stat32i64* buf);
44 int _fstat64i32(int fd, struct _stat64i32* buf);
45 #else
46 int fstat(int fd, struct stat* buf) NOTHROW;
47 #endif
48 int fsync(int fd);
49 char* NAME(getcwd)(char* buf, getcwd_size_t size) NOTHROW;
50 char* getwd(char* buf) NOTHROW;
51 int getdents(int fd, void* buf, unsigned int count) NOTHROW;
52 int NAME(isatty)(int fd) NOTHROW;
53 off_t NAME(lseek)(int fd, off_t offset, int whence) NOTHROW;
54 #if defined(WIN32)
55 int _mkdir(const char* path);
56 #else
57 int mkdir(const char* path, mode_t mode) NOTHROW;
58 #endif
59 int mount(const char* source, const char* target, const char* filesystemtype,
60 unsigned long mountflags, const void* data) NOTHROW;
61 int NAME(open)(const char* path, int oflag, ...);
62 read_ssize_t NAME(read)(int fd, void* buf, size_t nbyte);
63 int remove(const char* path) NOTHROW;
64 int NAME(rmdir)(const char* path) NOTHROW;
65 #if defined(WIN32)
66 int _stat32(const char* path, struct _stat32* buf);
67 int _stat64(const char* path, struct _stat64* buf);
68 int _stat32i64(const char* path, struct _stat32i64* buf);
69 int _stat64i32(const char* path, struct _stat64i32* buf);
70 #else
71 int stat(const char* path, struct stat* buf) NOTHROW;
72 #endif
73 int umount(const char* path) NOTHROW;
74 int NAME(unlink)(const char* path) NOTHROW;
75 read_ssize_t NAME(write)(int fd, const void* buf, size_t nbyte);
76
77 EXTERN_C_END
78
79 #endif // LIBRARIES_NACL_MOUNTS_KERNEL_WRAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698