OLD | NEW |
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2013 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 _GNU_SOURCE |
5 #define _GNU_SOURCE | 6 #define _GNU_SOURCE |
| 7 #endif |
6 #include <stdio.h> | 8 #include <stdio.h> |
7 #include <sys/types.h> | 9 #include <sys/types.h> |
8 #include <unistd.h> | 10 #include <unistd.h> |
9 | 11 |
10 #if defined(__native_client__) && defined(__GLIBC__) | 12 #if defined(__native_client__) && defined(__GLIBC__) |
11 | 13 |
12 static ssize_t fdopen_read(void *cookie, char *buf, size_t size) { | 14 static ssize_t fdopen_read(void *cookie, char *buf, size_t size) { |
13 return read((int) cookie, buf, size); | 15 return read((int) cookie, buf, size); |
14 } | 16 } |
15 | 17 |
(...skipping 25 matching lines...) Expand all Loading... |
41 * TODO(bradnelson): Remove this glibc is fixed. | 43 * TODO(bradnelson): Remove this glibc is fixed. |
42 * See: https://code.google.com/p/nativeclient/issues/detail?id=3362 | 44 * See: https://code.google.com/p/nativeclient/issues/detail?id=3362 |
43 * Workaround fdopen in glibc failing due to it vetting the provided file | 45 * Workaround fdopen in glibc failing due to it vetting the provided file |
44 * handles with fcntl which is not currently interceptable. | 46 * handles with fcntl which is not currently interceptable. |
45 */ | 47 */ |
46 FILE *fdopen(int fildes, const char *mode) { | 48 FILE *fdopen(int fildes, const char *mode) { |
47 return fopencookie((void *) fildes, mode, fdopen_functions); | 49 return fopencookie((void *) fildes, mode, fdopen_functions); |
48 } | 50 } |
49 | 51 |
50 #endif /* defined(__native_client__) && defined(__GLIBC__) */ | 52 #endif /* defined(__native_client__) && defined(__GLIBC__) */ |
OLD | NEW |