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 <assert.h> | 8 #include <assert.h> |
9 #include <signal.h> | 9 #include <signal.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
11 #include <stdlib.h> | 11 #include <stdlib.h> |
12 #include <sys/fcntl.h> | 12 #include <sys/fcntl.h> |
13 #include <sys/ioctl.h> | 13 #include <sys/ioctl.h> |
14 #include <sys/types.h> | 14 #include <sys/types.h> |
15 | 15 |
16 #include "nacl_io/ossignal.h" | 16 #include "nacl_io/ossignal.h" |
17 #include "nacl_io/ossocket.h" | 17 #include "nacl_io/ossocket.h" |
18 #include "nacl_io/ostypes.h" | 18 #include "nacl_io/ostypes.h" |
19 #include "nacl_io/osutime.h" | 19 #include "nacl_io/osutime.h" |
20 #include "sdk_util/macros.h" | 20 #include "sdk_util/macros.h" |
21 | 21 |
| 22 // Curently enable NaCl IO IRT Extension when using arm glibc (which |
| 23 // only supports this method interception). |
| 24 #if defined(__native_client__) && defined(__GLIBC__) && defined(__arm__) |
| 25 # define NACL_IO_IRT_EXT 1 |
| 26 #endif |
| 27 |
22 #if defined(__GLIBC__) | 28 #if defined(__GLIBC__) |
23 #include <sys/cdefs.h> | 29 #include <sys/cdefs.h> |
24 #define NOTHROW __THROW | 30 #define NOTHROW __THROW |
25 #else | 31 #else |
26 #define NOTHROW | 32 #define NOTHROW |
27 #endif | 33 #endif |
28 | 34 |
29 // Most kernel intercept functions (ki_*) return -1 and set the global errno. | 35 // Most kernel intercept functions (ki_*) return -1 and set the global errno. |
30 // However, the IRT wrappers are expected to return errno on failure. These | 36 // However, the IRT wrappers are expected to return errno on failure. These |
31 // macros are used in the wrappers to check that the ki_ function actually | 37 // macros are used in the wrappers to check that the ki_ function actually |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 ssize_t sendmsg(int fd, const struct msghdr* msg, int flags); | 154 ssize_t sendmsg(int fd, const struct msghdr* msg, int flags); |
149 int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len); | 155 int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len); |
150 int shutdown(int fd, int how); | 156 int shutdown(int fd, int how); |
151 int socket(int domain, int type, int protocol); | 157 int socket(int domain, int type, int protocol); |
152 int socketpair(int domain, int type, int protocl, int* sv); | 158 int socketpair(int domain, int type, int protocl, int* sv); |
153 #endif // PROVIDES_SOCKET_API | 159 #endif // PROVIDES_SOCKET_API |
154 | 160 |
155 EXTERN_C_END | 161 EXTERN_C_END |
156 | 162 |
157 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ | 163 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ |
OLD | NEW |