-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move the method to look up process to a common place
Summary: As title in the task, I need to look up process info using this method. Move it to shared util class so that I can include them else where Reviewed By: kmancini Differential Revision: D49654377 fbshipit-source-id: d071926d023ef3a8cf2c92e1a328e4db11961bc5
- Loading branch information
1 parent
a5aee68
commit 5f6d432
Showing
4 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "watchman/ProcessUtil.h" | ||
|
||
#include "eden/common/utils/ProcessInfoCache.h" | ||
|
||
namespace watchman { | ||
|
||
using namespace facebook::eden; | ||
|
||
namespace { | ||
ProcessInfoCache& getProcessInfoCache() { | ||
static auto* pic = new ProcessInfoCache; | ||
return *pic; | ||
} | ||
} // namespace | ||
|
||
ProcessInfoHandle lookupProcessInfo(pid_t pid) { | ||
return getProcessInfoCache().lookup(pid); | ||
} | ||
|
||
} // namespace watchman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <folly/portability/SysTypes.h> | ||
|
||
namespace facebook::eden { | ||
class ProcessInfoHandle; | ||
} | ||
|
||
namespace watchman { | ||
|
||
using ProcessInfoHandle = facebook::eden::ProcessInfoHandle; | ||
|
||
ProcessInfoHandle lookupProcessInfo(pid_t pid); | ||
|
||
} // namespace watchman |