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