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, const char* path, |
| 48 intptr_t* dirfd, const char** resolved_path) { |
| 49 UNIMPLEMENTED(); |
| 50 return false; |
| 51 } |
| 52 |
| 53 NamespaceScope::NamespaceScope(Namespace* namespc, const char* path) { |
| 54 UNIMPLEMENTED(); |
| 55 } |
| 56 |
| 57 NamespaceScope::~NamespaceScope() { |
| 58 UNIMPLEMENTED(); |
| 59 } |
| 60 |
| 61 } // namespace bin |
| 62 } // namespace dart |
| 63 |
| 64 #endif // defined(HOST_OS_MACOS) |
OLD | NEW |