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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 fclose(file); | 349 fclose(file); |
350 return NULL; | 350 return NULL; |
351 } | 351 } |
352 | 352 |
353 | 353 |
354 bool OS::Remove(const char* path) { | 354 bool OS::Remove(const char* path) { |
355 return (remove(path) == 0); | 355 return (remove(path) == 0); |
356 } | 356 } |
357 | 357 |
358 | 358 |
| 359 bool OS::isDirectorySeparator(const char ch) { |
| 360 return ch == '/'; |
| 361 } |
| 362 |
| 363 |
359 FILE* OS::OpenTemporaryFile() { | 364 FILE* OS::OpenTemporaryFile() { |
360 return tmpfile(); | 365 return tmpfile(); |
361 } | 366 } |
362 | 367 |
363 | 368 |
364 const char* const OS::LogFileOpenMode = "w"; | 369 const char* const OS::LogFileOpenMode = "w"; |
365 | 370 |
366 | 371 |
367 void OS::Print(const char* format, ...) { | 372 void OS::Print(const char* format, ...) { |
368 va_list args; | 373 va_list args; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 | 695 |
691 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 696 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
692 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 697 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
693 int result = pthread_setspecific(pthread_key, value); | 698 int result = pthread_setspecific(pthread_key, value); |
694 DCHECK_EQ(0, result); | 699 DCHECK_EQ(0, result); |
695 USE(result); | 700 USE(result); |
696 } | 701 } |
697 | 702 |
698 | 703 |
699 } } // namespace v8::base | 704 } } // namespace v8::base |
OLD | NEW |