diff options
author | Andy Schwerin <schwerin@10gen.com> | 2013-05-23 13:43:28 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2013-06-03 18:53:52 -0400 |
commit | 9b148b0419d79f7173d0e972e8427fea67f77616 (patch) | |
tree | bc9c96a4a82c4384a7d5220b69417eb1835b922c /src/mongo/platform/process_id.h | |
parent | 06c6c3b6fb835e1bcc62e5f725aca6d815cfb42e (diff) | |
download | mongo-9b148b0419d79f7173d0e972e8427fea67f77616.tar.gz |
SERVER-9809 Replace getpid() with ProcessId::getCurrent() and pid_t with ProcessId.
Diffstat (limited to 'src/mongo/platform/process_id.h')
-rw-r--r-- | src/mongo/platform/process_id.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/platform/process_id.h b/src/mongo/platform/process_id.h index 208b921a1c0..1f067307667 100644 --- a/src/mongo/platform/process_id.h +++ b/src/mongo/platform/process_id.h @@ -16,6 +16,7 @@ #pragma once #include <iosfwd> +#include <string> #ifndef _WIN32 #include <unistd.h> @@ -80,6 +81,11 @@ namespace mongo { */ uint32_t asUInt32() const { return static_cast<uint32_t>(_npid); } + /** + * Provides a string representation of the pid. + */ + std::string toString() const; + bool operator==(const ProcessId other) const { return _npid == other._npid; } bool operator!=(const ProcessId other) const { return _npid != other._npid; } bool operator<(const ProcessId other) const { return _npid < other._npid; } |