OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 double OS::DaylightSavingsOffset(double time) { | 102 double OS::DaylightSavingsOffset(double time) { |
103 if (isnan(time)) return nan_value(); | 103 if (isnan(time)) return nan_value(); |
104 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); | 104 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
105 struct tm* t = localtime(&tv); | 105 struct tm* t = localtime(&tv); |
106 if (NULL == t) return nan_value(); | 106 if (NULL == t) return nan_value(); |
107 return t->tm_isdst > 0 ? 3600 * msPerSecond : 0; | 107 return t->tm_isdst > 0 ? 3600 * msPerSecond : 0; |
108 } | 108 } |
109 | 109 |
110 | 110 |
| 111 int OS::GetLastError() { |
| 112 return errno; |
| 113 } |
| 114 |
| 115 |
111 // ---------------------------------------------------------------------------- | 116 // ---------------------------------------------------------------------------- |
112 // POSIX stdio support. | 117 // POSIX stdio support. |
113 // | 118 // |
114 | 119 |
115 FILE* OS::FOpen(const char* path, const char* mode) { | 120 FILE* OS::FOpen(const char* path, const char* mode) { |
116 return fopen(path, mode); | 121 return fopen(path, mode); |
117 } | 122 } |
118 | 123 |
119 | 124 |
120 const char* OS::LogFileOpenMode = "w"; | 125 const char* OS::LogFileOpenMode = "w"; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 return ntohl(value); | 358 return ntohl(value); |
354 } | 359 } |
355 | 360 |
356 | 361 |
357 Socket* OS::CreateSocket() { | 362 Socket* OS::CreateSocket() { |
358 return new POSIXSocket(); | 363 return new POSIXSocket(); |
359 } | 364 } |
360 | 365 |
361 | 366 |
362 } } // namespace v8::internal | 367 } } // namespace v8::internal |
OLD | NEW |