| 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" | |
| 17 #include "nacl_io/ossocket.h" | 16 #include "nacl_io/ossocket.h" |
| 18 #include "nacl_io/ostypes.h" | 17 #include "nacl_io/ostypes.h" |
| 19 #include "nacl_io/osutime.h" | 18 #include "nacl_io/osutime.h" |
| 20 #include "sdk_util/macros.h" | 19 #include "sdk_util/macros.h" |
| 21 | 20 |
| 22 // Curently enable NaCl IO IRT Extension when using newlib | |
| 23 #if defined(__native_client__) && defined(_NEWLIB_VERSION) | |
| 24 # define NACL_IO_IRT_EXT 1 | |
| 25 #endif | |
| 26 | |
| 27 #if defined(__GLIBC__) | 21 #if defined(__GLIBC__) |
| 28 #include <sys/cdefs.h> | 22 #include <sys/cdefs.h> |
| 29 #define NOTHROW __THROW | 23 #define NOTHROW __THROW |
| 30 #else | 24 #else |
| 31 #define NOTHROW | 25 #define NOTHROW |
| 32 #endif | 26 #endif |
| 33 | 27 |
| 34 // Most kernel intercept functions (ki_*) return -1 and set the global errno. | 28 // Most kernel intercept functions (ki_*) return -1 and set the global errno. |
| 35 // However, the IRT wrappers are expected to return errno on failure. These | 29 // However, the IRT wrappers are expected to return errno on failure. These |
| 36 // macros are used in the wrappers to check that the ki_ function actually | 30 // 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... |
| 153 ssize_t sendmsg(int fd, const struct msghdr* msg, int flags); | 147 ssize_t sendmsg(int fd, const struct msghdr* msg, int flags); |
| 154 int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len); | 148 int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len); |
| 155 int shutdown(int fd, int how); | 149 int shutdown(int fd, int how); |
| 156 int socket(int domain, int type, int protocol); | 150 int socket(int domain, int type, int protocol); |
| 157 int socketpair(int domain, int type, int protocl, int* sv); | 151 int socketpair(int domain, int type, int protocl, int* sv); |
| 158 #endif // PROVIDES_SOCKET_API | 152 #endif // PROVIDES_SOCKET_API |
| 159 | 153 |
| 160 EXTERN_C_END | 154 EXTERN_C_END |
| 161 | 155 |
| 162 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ | 156 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ |
| OLD | NEW |