OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium 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 BASE_MAC_LAUNCHD_H_ |
| 6 #define BASE_MAC_LAUNCHD_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <launch.h> |
| 10 #include <sys/types.h> |
| 11 |
| 12 #include <string> |
| 13 |
| 14 namespace base { |
| 15 namespace mac { |
| 16 |
| 17 // MessageForJob sends a single message to launchd with a simple dictionary |
| 18 // mapping |operation| to |job_label|, and returns the result of calling |
| 19 // launch_msg to send that message. On failure, returns NULL. The caller |
| 20 // assumes ownership of the returned launch_data_t object. |
| 21 launch_data_t MessageForJob(const std::string& job_label, |
| 22 const char* operation); |
| 23 |
| 24 // Returns the process ID for |job_label| if the job is running, 0 if the job |
| 25 // is loaded but not running, or -1 on error. |
| 26 pid_t PIDForJob(const std::string& job_label); |
| 27 |
| 28 } // namespace mac |
| 29 } // namespace base |
| 30 |
| 31 #endif // BASE_MAC_LAUNCHD_H_ |
OLD | NEW |