OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #include "platform/globals.h" |
| 6 #if defined(HOST_OS_MACOS) |
| 7 |
| 8 #include "bin/namespace.h" |
| 9 |
| 10 #include <errno.h> |
| 11 #include <fcntl.h> |
| 12 |
| 13 #include "bin/fdutils.h" |
| 14 #include "platform/signal_blocker.h" |
| 15 |
| 16 namespace dart { |
| 17 namespace bin { |
| 18 |
| 19 Namespace* Namespace::Create(const char* path) { |
| 20 UNIMPLEMENTED(); |
| 21 return NULL; |
| 22 } |
| 23 |
| 24 Namespace::~Namespace() { |
| 25 if (namespc_ != kNone) { |
| 26 VOID_TEMP_FAILURE_RETRY(close(namespc_)); |
| 27 } |
| 28 } |
| 29 |
| 30 intptr_t Namespace::Default() { |
| 31 return kNone; |
| 32 } |
| 33 |
| 34 const char* Namespace::GetCurrent(Namespace* namespc) { |
| 35 char buffer[PATH_MAX]; |
| 36 if (getcwd(buffer, PATH_MAX) == NULL) { |
| 37 return NULL; |
| 38 } |
| 39 return DartUtils::ScopedCopyCString(buffer); |
| 40 } |
| 41 |
| 42 bool Namespace::SetCurrent(Namespace* namespc, const char* path) { |
| 43 int result = NO_RETRY_EXPECTED(chdir(path)); |
| 44 return (result == 0); |
| 45 } |
| 46 |
| 47 bool Namespace::ResolvePath(Namespace* namespc, |
| 48 const char* path, |
| 49 intptr_t* dirfd, |
| 50 const char** resolved_path) { |
| 51 UNIMPLEMENTED(); |
| 52 return false; |
| 53 } |
| 54 |
| 55 NamespaceScope::NamespaceScope(Namespace* namespc, const char* path) { |
| 56 UNIMPLEMENTED(); |
| 57 } |
| 58 |
| 59 NamespaceScope::~NamespaceScope() { |
| 60 UNIMPLEMENTED(); |
| 61 } |
| 62 |
| 63 } // namespace bin |
| 64 } // namespace dart |
| 65 |
| 66 #endif // defined(HOST_OS_MACOS) |
OLD | NEW |