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

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

Issue 9817002: Add OS::GetCurrentProcessId and prepend output from trace-gc with the current pid (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: updates Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/platform.h ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) 145 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction())
146 146
147 #undef MATH_FUNCTION 147 #undef MATH_FUNCTION
148 148
149 149
150 double OS::nan_value() { 150 double OS::nan_value() {
151 // NAN from math.h is defined in C99 and not in POSIX. 151 // NAN from math.h is defined in C99 and not in POSIX.
152 return NAN; 152 return NAN;
153 } 153 }
154 154
155 int OS::GetCurrentProcessId() {
156 return static_cast<int>(getpid());
157 }
155 158
156 // ---------------------------------------------------------------------------- 159 // ----------------------------------------------------------------------------
157 // POSIX date/time support. 160 // POSIX date/time support.
158 // 161 //
159 162
160 int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) { 163 int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
161 struct rusage usage; 164 struct rusage usage;
162 165
163 if (getrusage(RUSAGE_SELF, &usage) < 0) return -1; 166 if (getrusage(RUSAGE_SELF, &usage) < 0) return -1;
164 *secs = usage.ru_utime.tv_sec; 167 *secs = usage.ru_utime.tv_sec;
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 return ntohl(value); 539 return ntohl(value);
537 } 540 }
538 541
539 542
540 Socket* OS::CreateSocket() { 543 Socket* OS::CreateSocket() {
541 return new POSIXSocket(); 544 return new POSIXSocket();
542 } 545 }
543 546
544 547
545 } } // namespace v8::internal 548 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform.h ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698