OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 // Platform-specific code for POSIX goes here. This is not a platform on its | 5 // Platform-specific code for POSIX goes here. This is not a platform on its |
6 // own, but contains the parts which are the same across the POSIX platforms | 6 // own, but contains the parts which are the same across the POSIX platforms |
7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. | 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 if (is_regular_file) return file; | 422 if (is_regular_file) return file; |
423 fclose(file); | 423 fclose(file); |
424 return NULL; | 424 return NULL; |
425 } | 425 } |
426 | 426 |
427 | 427 |
428 bool OS::Remove(const char* path) { | 428 bool OS::Remove(const char* path) { |
429 return (remove(path) == 0); | 429 return (remove(path) == 0); |
430 } | 430 } |
431 | 431 |
| 432 char OS::DirectorySeparator() { return '/'; } |
432 | 433 |
433 bool OS::isDirectorySeparator(const char ch) { | 434 bool OS::isDirectorySeparator(const char ch) { |
434 return ch == '/'; | 435 return ch == DirectorySeparator(); |
435 } | 436 } |
436 | 437 |
437 | 438 |
438 FILE* OS::OpenTemporaryFile() { | 439 FILE* OS::OpenTemporaryFile() { |
439 return tmpfile(); | 440 return tmpfile(); |
440 } | 441 } |
441 | 442 |
442 | 443 |
443 const char* const OS::LogFileOpenMode = "w"; | 444 const char* const OS::LogFileOpenMode = "w"; |
444 | 445 |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 763 |
763 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 764 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
764 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 765 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
765 int result = pthread_setspecific(pthread_key, value); | 766 int result = pthread_setspecific(pthread_key, value); |
766 DCHECK_EQ(0, result); | 767 DCHECK_EQ(0, result); |
767 USE(result); | 768 USE(result); |
768 } | 769 } |
769 | 770 |
770 } // namespace base | 771 } // namespace base |
771 } // namespace v8 | 772 } // namespace v8 |
OLD | NEW |