OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 CHROME_BROWSER_MAC_LAUNCHD_H_ |
| 6 #define CHROME_BROWSER_MAC_LAUNCHD_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 namespace launchd { |
| 12 |
| 13 // Equivalent to running "launchctl start |job_label|" from the command line. |
| 14 // Returns the errno obtained from making the request of launchd, 0 on |
| 15 // success, and -1 when no response could be made of launchd. |
| 16 int StartJob(const std::string& job_label); |
| 17 |
| 18 // As with StartJob, but for stopping jobs. Equivalent to "launchctl stop |
| 19 // |job_label|." Note that launchd may restart a stopped job immediately or |
| 20 // at some point in the future even without an explicit call to StartJob. |
| 21 int StopJob(const std::string& job_label); |
| 22 |
| 23 // Runs StopJob, and if successful, then StartJob. |
| 24 void RestartJob(const std::string& job_label); |
| 25 |
| 26 // Returns the PID for job_label, or -1 on error. |
| 27 int PIDForJob(const std::string& job_label); |
| 28 |
| 29 // Sends a signal to the job at job_label. |
| 30 void SignalJob(const std::string& job_label, int signal); |
| 31 |
| 32 } // namespace launchd |
| 33 |
| 34 #endif // CHROME_BROWSER_MAC_LAUNCHD_H_ |
OLD | NEW |