| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef LOGIN_MANAGER_SYSTEM_UTILS_H_ |
| 6 #define LOGIN_MANAGER_SYSTEM_UTILS_H_ |
| 7 |
| 8 #include <errno.h> |
| 9 #include <unistd.h> |
| 10 |
| 11 #include <base/basictypes.h> |
| 12 |
| 13 namespace login_manager { |
| 14 class SystemUtils { |
| 15 public: |
| 16 SystemUtils() {} |
| 17 virtual ~SystemUtils() {} |
| 18 |
| 19 virtual int kill(pid_t pid, int signal) { |
| 20 return ::kill(pid, signal); |
| 21 } |
| 22 |
| 23 virtual bool child_is_gone(pid_t child_spec) { |
| 24 return ::waitpid(child_spec, NULL, WNOHANG) == -1 && errno == ECHILD; |
| 25 } |
| 26 |
| 27 private: |
| 28 DISALLOW_COPY_AND_ASSIGN(SystemUtils); |
| 29 }; |
| 30 } // namespace login_manager |
| 31 |
| 32 #endif // LOGIN_MANAGER_SYSTEM_UTILS_H_ |
| OLD | NEW |