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

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

Issue 608913003: Added support for NaCl IO to use the IRT Extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize all interfaces on init Created 6 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
OLDNEW
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/ossocket.h" 17 #include "nacl_io/ossocket.h"
17 #include "nacl_io/ostypes.h" 18 #include "nacl_io/ostypes.h"
18 #include "nacl_io/osutime.h" 19 #include "nacl_io/osutime.h"
19 #include "sdk_util/macros.h" 20 #include "sdk_util/macros.h"
20 21
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
21 #if defined(__GLIBC__) 27 #if defined(__GLIBC__)
22 #include <sys/cdefs.h> 28 #include <sys/cdefs.h>
23 #define NOTHROW __THROW 29 #define NOTHROW __THROW
24 #else 30 #else
25 #define NOTHROW 31 #define NOTHROW
26 #endif 32 #endif
27 33
28 // Most kernel intercept functions (ki_*) return -1 and set the global errno. 34 // Most kernel intercept functions (ki_*) return -1 and set the global errno.
29 // However, the IRT wrappers are expected to return errno on failure. These 35 // However, the IRT wrappers are expected to return errno on failure. These
30 // macros are used in the wrappers to check that the ki_ function actually 36 // 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
147 ssize_t sendmsg(int fd, const struct msghdr* msg, int flags); 153 ssize_t sendmsg(int fd, const struct msghdr* msg, int flags);
148 int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len); 154 int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len);
149 int shutdown(int fd, int how); 155 int shutdown(int fd, int how);
150 int socket(int domain, int type, int protocol); 156 int socket(int domain, int type, int protocol);
151 int socketpair(int domain, int type, int protocl, int* sv); 157 int socketpair(int domain, int type, int protocl, int* sv);
152 #endif // PROVIDES_SOCKET_API 158 #endif // PROVIDES_SOCKET_API
153 159
154 EXTERN_C_END 160 EXTERN_C_END
155 161
156 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_ 162 #endif // LIBRARIES_NACL_IO_KERNEL_WRAP_H_
OLDNEW
« no previous file with comments | « native_client_sdk/src/build_tools/build_sdk.py ('k') | native_client_sdk/src/libraries/nacl_io/kernel_wrap_bionic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698