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 #if defined(__native_client__) | 5 #if defined(__native_client__) |
6 #include <errno.h> | 6 #include <errno.h> |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #endif | 9 #endif |
10 | 10 |
11 extern "C" { | 11 extern "C" { |
12 | 12 |
13 #if defined(__native_client__) | 13 #if defined(__native_client__) |
14 | 14 |
| 15 char* getcwd(char* buf, size_t size) __attribute__ ((weak)); |
| 16 int unlink(const char* pathname) __attribute__ ((weak)); |
| 17 int mkdir(const char* pathname, mode_t mode) __attribute__ ((weak)); |
| 18 |
15 char* getcwd(char* buf, size_t size) { | 19 char* getcwd(char* buf, size_t size) { |
16 if (size < 2) { | 20 if (size < 2) { |
17 errno = ERANGE; | 21 errno = ERANGE; |
18 return NULL; | 22 return NULL; |
19 } | 23 } |
20 | 24 |
21 return strncpy(buf, ".", size); | 25 return strncpy(buf, ".", size); |
22 } | 26 } |
23 | 27 |
24 int unlink(const char* pathname) { | 28 int unlink(const char* pathname) { |
25 errno = ENOSYS; | 29 errno = ENOSYS; |
26 return -1; | 30 return -1; |
27 } | 31 } |
28 | 32 |
29 int mkdir(const char* pathname, mode_t mode) { | 33 int mkdir(const char* pathname, mode_t mode) { |
30 errno = ENOSYS; | 34 errno = ENOSYS; |
31 return -1; | 35 return -1; |
32 } | 36 } |
33 | 37 |
34 #endif | 38 #endif |
35 | 39 |
36 } // extern "C" | 40 } // extern "C" |
OLD | NEW |