Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: src/platform-posix.cc

Issue 3118013: Add last OS error into heap stats. (Closed)
Patch Set: rename errno to os_error Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/platform-nullos.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/platform-nullos.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698