diff options
| author | San Mehat <san@google.com> | 2010-02-16 17:12:00 -0800 |
|---|---|---|
| committer | San Mehat <san@google.com> | 2010-02-16 17:12:00 -0800 |
| commit | 586536c60b773e3517531ad8a6cb0de6722c67fc (patch) | |
| tree | afd0ab67daf64d18ef7bfca282d82e14d74d2f09 /Process.h | |
| parent | 8c940ef7dbd423cadc92982b44a65ed1014389e2 (diff) | |
| download | android_system_vold-586536c60b773e3517531ad8a6cb0de6722c67fc.tar.gz android_system_vold-586536c60b773e3517531ad8a6cb0de6722c67fc.tar.bz2 android_system_vold-586536c60b773e3517531ad8a6cb0de6722c67fc.zip | |
vold: Refactor Processkiller and add command to return users of a mount point
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'Process.h')
| -rw-r--r-- | Process.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Process.h b/Process.h new file mode 100644 index 0000000..fc0c0b7 --- /dev/null +++ b/Process.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _PROCESS_H +#define _PROCESS_H + +class Process { +public: + static void killProcessesWithOpenFiles(const char *path, int action); + static int getPid(const char *s); + static int checkSymLink(int pid, const char *path, const char *name); + static int checkFileMaps(int pid, const char *path); + static int checkFileMaps(int pid, const char *path, char *openFilename, size_t max); + static int checkFileDescriptorSymLinks(int pid, const char *mountPoint); + static int checkFileDescriptorSymLinks(int pid, const char *mountPoint, char *openFilename, size_t max); + static void getProcessName(int pid, char *buffer, size_t max); +private: + static int readSymLink(const char *path, char *link, size_t max); + static int pathMatchesMountPoint(const char *path, const char *mountPoint); +}; + +#endif |
